diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile /login/IPSL_CODE/AssimilBranche/modeles/ORCHIDEE/src_parameters/constantes_soil.f90 /login/IPSL_CODE/ORCHIDEE_1_9_5_2/modeles/ORCHIDEE/src_parameters/constantes_soil.f90
152,155d151
< !-
< ! Check the water balance
<   LOGICAL, SAVE                    :: check_waterbal=.FALSE.
< 
diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile /login/IPSL_CODE/AssimilBranche/modeles/ORCHIDEE/src_sechiba/condveg.f90 /login/IPSL_CODE/ORCHIDEE_1_9_5_2/modeles/ORCHIDEE/src_sechiba/condveg.f90
10c10
< !< $HeadURL: svn://forge.ipsl.jussieu.fr/orchidee/tags/ORCHIDEE_1_9_5_2/ORCHIDEE/src_sechiba/condveg.f90 $
---
> !< $HeadURL: svn://forge.ipsl.jussieu.fr/orchidee/trunk/ORCHIDEE/src_sechiba/condveg.f90 $
69,77d68
< ! List of subroutines for initialization :
< !- condveg_init
< !- condveg_clear
< !- condveg_var_init
< !- condveg_snow
< !- condveg_soilalb
< !- condveg_z0logz
< !- condveg_z0cdrag
< !- condveg_albcalc
881d871
<   ok_interpol=.FALSE.
diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile /login/IPSL_CODE/AssimilBranche/modeles/ORCHIDEE/src_sechiba/diffuco.f90 /login/IPSL_CODE/ORCHIDEE_1_9_5_2/modeles/ORCHIDEE/src_sechiba/diffuco.f90
7c7
< !< $HeadURL: svn://forge.ipsl.jussieu.fr/orchidee/tags/ORCHIDEE_1_9_5_2/ORCHIDEE/src_sechiba/diffuco.f90 $
---
> !< $HeadURL: svn://forge.ipsl.jussieu.fr/orchidee/trunk/ORCHIDEE/src_sechiba/diffuco.f90 $
36a37
>   CHARACTER(LEN=80)                                 :: var_name                  !! To store variables names for I/O
48,50d48
< ! List of subroutines for initialization :
< !- diffuco_init
< !- diffuco_clear
75,76c73,74
< !     & zlev, z0, roughheight, temp_sol, temp_air, rau, tq_cdrag, qsurf, qair, pb, &
<      & zlev, z0, roughheight, temp_sol, temp_air, rau, tq_cdrag, qsurf, qair, q2m, t2m, pb, &
---
> !     & zlev, z0, roughheight, temp_sol, temp_air, rau, q_cdrag, qsurf, qair, pb, &
>      & zlev, z0, roughheight, temp_sol, temp_air, rau, q_cdrag, qsurf, qair, q2m, t2m, pb, &
126c124
<     REAL(r_std),DIMENSION (kjpindex), INTENT (inout)   :: tq_cdrag          !! Surface drag ! Aerodynamic conductance
---
>     REAL(r_std),DIMENSION (kjpindex), INTENT (inout)   :: q_cdrag          !! Surface drag ! Aerodynamic conductance
144d141
<     CHARACTER(LEN=80)                                 :: var_name   !! To store variables names for I/O
152,153c149,150
<         !Config Def  = TRUE if tq_cdrag on initialization is non zero
<         !Config Help = Set to .TRUE. if you want tq_cdrag coming from GCM.
---
>         !Config Def  = TRUE if q_cdrag on initialization is non zero
>         !Config Help = Set to .TRUE. if you want q_cdrag coming from GCM.
155c152
<         IF ( ABS(MAXVAL(tq_cdrag)) .LE. EPSILON(tq_cdrag)) THEN
---
>         IF ( ABS(MAXVAL(q_cdrag)) .LE. EPSILON(q_cdrag)) THEN
160c157
< !MM tq_cdrag is always 0 on initialization ??
---
> !MM q_cdrag is always 0 on initialization ??
168c165
<         CALL diffuco_init(kjit, ldrestart_read, kjpindex, index, rest_id, tq_cdrag)
---
>         CALL diffuco_init(kjit, ldrestart_read, kjpindex, index, rest_id, q_cdrag)
207c204
<            CALL restput_p (rest_id, var_name, nbp_glo, 1, 1, kjit, tq_cdrag, 'scatter',  nbp_glo, index_g)
---
>            CALL restput_p (rest_id, var_name, nbp_glo, 1, 1, kjit, q_cdrag, 'scatter',  nbp_glo, index_g)
221c218
<             &             qsurf, qair, tq_cdrag)
---
>             &             qsurf, qair, q_cdrag)
223c220
<     CALL diffuco_raerod (kjpindex, u, v, tq_cdrag, raero)
---
>     CALL diffuco_raerod (kjpindex, u, v, q_cdrag, raero)
235c232
<     CALL diffuco_snow (kjpindex, dtradia, qair, qsatt, rau, u, v, tq_cdrag, &
---
>     CALL diffuco_snow (kjpindex, dtradia, qair, qsatt, rau, u, v, q_cdrag, &
243c240
<     !CALL diffuco_inter (kjpindex, dtradia, qair, qsatt, rau, u, v, tq_cdrag, veget, &
---
>     !CALL diffuco_inter (kjpindex, dtradia, qair, qsatt, rau, u, v, q_cdrag, veget, &
245c242
<     CALL diffuco_inter (kjpindex, dtradia, qair, qsatt, rau, u, v, tq_cdrag, veget, &
---
>     CALL diffuco_inter (kjpindex, dtradia, qair, qsatt, rau, u, v, q_cdrag, veget, &
251c248
<     CALL diffuco_bare (kjpindex, dtradia, u, v, tq_cdrag, rsol, evap_bare_lim, evapot, humrel, veget, vbeta4) 
---
>     CALL diffuco_bare (kjpindex, dtradia, u, v, q_cdrag, rsol, evap_bare_lim, evapot, humrel, veget, vbeta4) 
261c258
<       !CALL diffuco_trans_co2 (kjpindex, dtradia, swdown, temp_air, pb, qair, rau, u, v, tq_cdrag, humrel, &
---
>       !CALL diffuco_trans_co2 (kjpindex, dtradia, swdown, temp_air, pb, qair, rau, u, v, q_cdrag, humrel, &
265c262
<       CALL diffuco_trans_co2 (kjpindex, dtradia, swdown, temp_air, pb, qair, q2m, t2m, rau, u, v, tq_cdrag, humrel, &
---
>       CALL diffuco_trans_co2 (kjpindex, dtradia, swdown, temp_air, pb, qair, q2m, t2m, rau, u, v, q_cdrag, humrel, &
272c269
<       !CALL diffuco_trans (kjpindex, dtradia, swnet, temp_air, pb, qair, rau, u, v, tq_cdrag, humrel, &
---
>       !CALL diffuco_trans (kjpindex, dtradia, swnet, temp_air, pb, qair, rau, u, v, q_cdrag, humrel, &
275c272
<       CALL diffuco_trans (kjpindex, dtradia, swnet, temp_air, pb, qair, rau, u, v, tq_cdrag, humrel, &
---
>       CALL diffuco_trans (kjpindex, dtradia, swnet, temp_air, pb, qair, rau, u, v, q_cdrag, humrel, &
285c282
<     CALL diffuco_comb (kjpindex, dtradia, humrel, rau, u, v, tq_cdrag, pb, qair, temp_sol, temp_air, snow, &
---
>     CALL diffuco_comb (kjpindex, dtradia, humrel, rau, u, v, q_cdrag, pb, qair, temp_sol, temp_air, snow, &
292c289
<        CALL histwrite(hist_id, 'cdrag', kjit, tq_cdrag, kjpindex, index)
---
>        CALL histwrite(hist_id, 'cdrag', kjit, q_cdrag, kjpindex, index)
301c298
<           CALL histwrite(hist2_id, 'cdrag', kjit, tq_cdrag, kjpindex, index)
---
>           CALL histwrite(hist2_id, 'cdrag', kjit, q_cdrag, kjpindex, index)
336d332
<     CHARACTER(LEN=80)               :: var_name           !! To store variables names for I/O
492,493d487
<       IF (ALLOCATED (qsatt)) DEALLOCATE (qsatt)
<       IF (ALLOCATED (wind)) DEALLOCATE (wind)
diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile /login/IPSL_CODE/AssimilBranche/modeles/ORCHIDEE/src_sechiba/enerbil.f90 /login/IPSL_CODE/ORCHIDEE_1_9_5_2/modeles/ORCHIDEE/src_sechiba/enerbil.f90
7c7
< !< $HeadURL: svn://forge.ipsl.jussieu.fr/orchidee/tags/ORCHIDEE_1_9_5_2/ORCHIDEE/src_sechiba/enerbil.f90 $
---
> !< $HeadURL: svn://forge.ipsl.jussieu.fr/orchidee/trunk/ORCHIDEE/src_sechiba/enerbil.f90 $
38a39,40
>   CHARACTER(LEN=80), SAVE                    :: var_name                !! To store variables names for I/O
> 
56,60d57
< ! List of subroutines for initialization :
< !- enerbil_init
< !- enerbil_clear
< !- enerbil_var_init
< !- enerbil_t2mdiag
82c79
<      & cimean, ccanopy, emis, soilflx, soilcap, tq_cdrag, humrel, fluxsens, fluxlat, &
---
>      & cimean, ccanopy, emis, soilflx, soilcap, q_cdrag, humrel, fluxsens, fluxlat, &
118c115
<     REAL(r_std),DIMENSION (kjpindex), INTENT (in)      :: tq_cdrag          !! This is the cdrag without the wind multiplied
---
>     REAL(r_std),DIMENSION (kjpindex), INTENT (in)      :: q_cdrag          !! This is the cdrag without the wind multiplied
146,147d142
<     CHARACTER(LEN=80)                :: var_name                !! To store variables names for I/O
< 
218c213
<        & epot_air, petAcoef, petBcoef, qair, peqAcoef, peqBcoef, soilflx, rau, u, v, tq_cdrag, vbeta,&
---
>        & epot_air, petAcoef, petBcoef, qair, peqAcoef, peqBcoef, soilflx, rau, u, v, q_cdrag, vbeta,&
226c221
<     CALL enerbil_flux (kjpindex, dtradia, emis, temp_sol, rau, u, v, tq_cdrag, vbeta, valpha, vbeta1, &
---
>     CALL enerbil_flux (kjpindex, dtradia, emis, temp_sol, rau, u, v, q_cdrag, vbeta, valpha, vbeta1, &
236c231
<        & ccanopy, rau, u, v, tq_cdrag, qair_new, humrel, vevapsno, vevapnu , vevapwet, transpir, gpp, evapot)
---
>        & ccanopy, rau, u, v, q_cdrag, qair_new, humrel, vevapsno, vevapnu , vevapwet, transpir, gpp, evapot)
303d297
<     CHARACTER(LEN=80)                :: var_name                !! To store variables names for I/O
diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile /login/IPSL_CODE/AssimilBranche/modeles/ORCHIDEE/src_sechiba/hydrolc.f90 /login/IPSL_CODE/ORCHIDEE_1_9_5_2/modeles/ORCHIDEE/src_sechiba/hydrolc.f90
7c7
< !< $HeadURL: svn://forge.ipsl.jussieu.fr/orchidee/tags/ORCHIDEE_1_9_5_2/ORCHIDEE/src_sechiba/hydrolc.f90 $
---
> !< $HeadURL: svn://forge.ipsl.jussieu.fr/orchidee/trunk/ORCHIDEE/src_sechiba/hydrolc.f90 $
40c40
<   LOGICAL, SAVE                                     :: l_first_hydrolc=.TRUE. !! Initialisation has to be done one time
---
>   LOGICAL, SAVE                                     :: l_first_hydrol=.TRUE. !! Initialisation has to be done one time
41a42
>   LOGICAL, SAVE                                     :: check_waterbal=.FALSE. !! The check the water balance
43a45,46
>   CHARACTER(LEN=80) , SAVE                          :: var_name         !! To store variables names for I/O
> 
83c86
<   REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:,:)    :: runoff_veg           !! Ruissellement
---
>   REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:,:)    :: runoff           !! Ruissellement
89,90d91
<   REAL(r_std), SAVE, DIMENSION(nvm)              :: throughfall_by_pft
< 
92,103d92
< ! List of subroutines for initialization :
< !- hydrolc_init
< !- hydrolc_clear
< !- hydrolc_var_init
< !- hydrolc_snow
< !- hydrolc_canop
< !- hydrolc_vegupd
< !- hydrolc_soil
< !- hydrolc_waterbal
< !- hydrolc_alma
< !- hydrolc_hdiff
< 
121c110
<      & temp_sol_new, runoff, drainage, frac_nobio, totfrac_nobio, vevapwet, veget, veget_max,&
---
>      & temp_sol_new, run_off_tot, drainage, frac_nobio, totfrac_nobio, vevapwet, veget, veget_max,&
166c155
<     REAL(r_std),DIMENSION (kjpindex), INTENT (inout)     :: runoff   !! Complete runoff
---
>     REAL(r_std),DIMENSION (kjpindex), INTENT (inout)     :: run_off_tot   !! Complete runoff
183,184d171
<     CHARACTER(LEN=80)                                  :: var_name !! To store variables names for I/O
< 
189c176
<     IF (l_first_hydrolc) THEN
---
>     IF (l_first_hydrol) THEN
191c178
<         IF (long_print) WRITE (numout,*) ' l_first_hydrolc : call hydrolc_init '
---
>         IF (long_print) WRITE (numout,*) ' l_first_hydrol : call hydrolc_init '
203c190
<                 & runoff, drainage)
---
>                 & run_off_tot, drainage)
289c276
<          & gqsb, bqsb, dsg, dss, rsol, drysoil_frac, hdry, dsp, runoff_veg, runoff, drainage, humrel, vegstress, &
---
>          & gqsb, bqsb, dsg, dss, rsol, drysoil_frac, hdry, dsp, runoff, run_off_tot, drainage, humrel, vegstress, &
303c290
<             & runoff, drainage )
---
>             & run_off_tot, drainage )
317c304
<        CALL histwrite(hist_id, 'runoff', kjit, runoff, kjpindex, index)
---
>        CALL histwrite(hist_id, 'runoff', kjit, run_off_tot, kjpindex, index)
339c326
<        histvar(:)=runoff(:)/one_day
---
>        histvar(:)=run_off_tot(:)/one_day
342c329
<        histvar(:)=(runoff(:)+drainage(:))/one_day
---
>        histvar(:)=(run_off_tot(:)+drainage(:))/one_day
351c338
<        CALL histwrite(hist_id, 'Qs', kjit, runoff, kjpindex, index)
---
>        CALL histwrite(hist_id, 'Qs', kjit, run_off_tot, kjpindex, index)
373c360
<           CALL histwrite(hist2_id, 'runoff', kjit, runoff, kjpindex, index)
---
>           CALL histwrite(hist2_id, 'runoff', kjit, run_off_tot, kjpindex, index)
392c379
<           histvar(:)=(runoff(:)+drainage(:))/one_day
---
>           histvar(:)=(run_off_tot(:)+drainage(:))/one_day
398c385
<           CALL histwrite(hist2_id, 'Qs', kjit, runoff, kjpindex, index)
---
>           CALL histwrite(hist2_id, 'Qs', kjit, run_off_tot, kjpindex, index)
455d441
<     CHARACTER(LEN=80)                                  :: var_name !! To store variables names for I/O
458,459c444,445
<     IF (l_first_hydrolc) THEN 
<         l_first_hydrolc=.FALSE.
---
>     IF (l_first_hydrol) THEN 
>         l_first_hydrol=.FALSE.
461c447
<         WRITE (numout,*) ' l_first_hydrolc false . we stop '
---
>         WRITE (numout,*) ' l_first_hydrol false . we stop '
607c593
<     ALLOCATE (runoff_veg(kjpindex,nvm),stat=ier)
---
>     ALLOCATE (runoff(kjpindex,nvm),stat=ier)
609c595
<         WRITE (numout,*) ' error in runoff_veg allocation. We stop. We need kjpindex words = ',kjpindex*nvm
---
>         WRITE (numout,*) ' error in runoff allocation. We stop. We need kjpindex words = ',kjpindex*nvm
612c598
<     runoff_veg(:,:) = zero
---
>     runoff(:,:) = zero
977,986d962
<     !Config  Key  = PERCENT_THROUGHFALL_PFT
<     !Config  Desc = Percent by PFT of precip that is not intercepted by the canopy
<     !Config  Def  = 30. 30. 30. 30. 30. 30. 30. 30. 30. 30. 30. 30. 30.
<     !Config  Help = During one rainfall event, PERCENT_THROUGHFALL_PFT% of the incident rainfall
<     !Config         will get directly to the ground without being intercepted, for each PFT.
<        
<     throughfall_by_pft = (/ 30., 30., 30., 30., 30., 30., 30., 30., 30., 30., 30., 30., 30. /)
<     CALL getin_p('PERCENT_THROUGHFALL_PFT',throughfall_by_pft)
<     throughfall_by_pft = throughfall_by_pft / 100.
<     !
995c971
<     l_first_hydrolc=.TRUE.
---
>     l_first_hydrol=.TRUE.
1015c991
<     IF (ALLOCATED  (runoff_veg)) DEALLOCATE (runoff_veg)
---
>     IF (ALLOCATED  (runoff)) DEALLOCATE (runoff)
1482a1459,1474
>     LOGICAL, SAVE                                  :: firstcall=.TRUE.
>     REAL(r_std), SAVE, DIMENSION(nvm)              :: throughfall_by_pft
> 
>     IF ( firstcall ) THEN
>        !Config  Key  = PERCENT_THROUGHFALL_PFT
>        !Config  Desc = Percent by PFT of precip that is not intercepted by the canopy
>        !Config  Def  = 30. 30. 30. 30. 30. 30. 30. 30. 30. 30. 30. 30. 30.
>        !Config  Help = During one rainfall event, PERCENT_THROUGHFALL_PFT% of the incident rainfall
>        !Config         will get directly to the ground without being intercepted, for each PFT.
>        
>        throughfall_by_pft = (/ 30., 30., 30., 30., 30., 30., 30., 30., 30., 30., 30., 30., 30. /)
>        CALL getin_p('PERCENT_THROUGHFALL_PFT',throughfall_by_pft)
>        throughfall_by_pft = throughfall_by_pft / 100.
> 
>        firstcall=.FALSE.
>     ENDIF
1690c1682
<        & gqsb, bqsb, dsg, dss, rsol, drysoil_frac, hdry, dsp, runoff_veg, run_off_tot, drainage, humrel, vegstress, &
---
>        & gqsb, bqsb, dsg, dss, rsol, drysoil_frac, hdry, dsp, runoff, run_off_tot, drainage, humrel, vegstress, &
1714c1706
<     REAL(r_std), DIMENSION (kjpindex,nvm), INTENT(out)       :: runoff_veg           !! Ruissellement
---
>     REAL(r_std), DIMENSION (kjpindex,nvm), INTENT(out)       :: runoff           !! Ruissellement
1833c1825
<     runoff_veg(:,:) = zero
---
>     runoff(:,:) = zero
1841c1833
<         runoff_veg(ji,jv) = MAX(gqsb(ji,jv) + bqsb(ji,jv) - mx_eau_var(ji), zero)
---
>         runoff(ji,jv) = MAX(gqsb(ji,jv) + bqsb(ji,jv) - mx_eau_var(ji), zero)
1946c1938
<       !      WRITE (numout,*) 'runoff_veg = ',runoff_veg(ji,jv)
---
>       !      WRITE (numout,*) 'runoff = ',runoff(ji,jv)
2079c2071
<             runoff_veg(ji,jv) = runoff_veg(ji,jv) + &
---
>             runoff(ji,jv) = runoff(ji,jv) + &
2116c2108
<         run_off_tot(ji) = run_off_tot(ji) + (runoff_veg(ji,jv)*veget(ji,jv))
---
>         run_off_tot(ji) = run_off_tot(ji) + (runoff(ji,jv)*veget(ji,jv))
2526c2518
<     LOGICAL, SAVE                                       :: firstcall_hdiff=.TRUE.
---
>     LOGICAL, SAVE                                       :: firstcall=.TRUE.
2528c2520
<     IF ( firstcall_hdiff ) THEN
---
>     IF ( firstcall ) THEN
2543c2535
<       firstcall_hdiff = .FALSE.
---
>       firstcall = .FALSE.
diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile /login/IPSL_CODE/AssimilBranche/modeles/ORCHIDEE/src_sechiba/hydrol.f90 /login/IPSL_CODE/ORCHIDEE_1_9_5_2/modeles/ORCHIDEE/src_sechiba/hydrol.f90
7c7
< !< $HeadURL: svn://forge.ipsl.jussieu.fr/orchidee/tags/ORCHIDEE_1_9_5_2/ORCHIDEE/src_sechiba/hydrol.f90 $
---
> !< $HeadURL: svn://forge.ipsl.jussieu.fr/orchidee/trunk/ORCHIDEE/src_sechiba/hydrol.f90 $
41a42
>   LOGICAL, SAVE                                     :: check_waterbal=.TRUE. !! The check the water balance
44a46
>   CHARACTER(LEN=80) , SAVE                          :: var_name         !! To store variables names for I/O
93c95
<   REAL(r_std), SAVE, DIMENSION (nslm+1,nstm)         :: zh               !! 
---
>   REAL(r_std), SAVE, DIMENSION (nslm+1,nstm)         :: zz               !! 
164,165d165
<   REAL(r_std), SAVE, DIMENSION(nvm)                 :: throughfall_by_pft
<     
167,181d166
< ! List of subroutines for initialization :
< !- hydrol_init
< !- hydrol_clear
< !- hydrol_var_init
< !- hydrol_snow
< !- hydrol_canop
< !- hydrol_vegupd
< !- hydrol_soil
< !- hydrol_soil_tridiag
< !- hydrol_soil_setup
< !- hydrol_split_soil
< !- hydrol_diag_soil
< !- hydrol_waterbal
< !- hydrol_alma
< 
203c188
<        & humrel, vegstress, drysoil_frac, evapot, evapot_corr, evap_bare_lim, &
---
>        & humrel, vegstress, drysoil_frac, evapot, evapot_penm, evap_bare_lim, &
236c221
<     REAL(r_std),DIMENSION (kjpindex), INTENT (in)      :: evapot_corr      !! Soil Potential Evaporation Correction
---
>     REAL(r_std),DIMENSION (kjpindex), INTENT (in)      :: evapot_penm      !! Soil Potential Evaporation Correction
264d248
<     CHARACTER(LEN=80)                                 :: var_name  !! To store variables names for I/O
371c355
<          & evapot_corr, runoff, drainage, returnflow, irrigation, &
---
>          & evapot_penm, runoff, drainage, returnflow, irrigation, &
509d492
<     CHARACTER(LEN=80)                                  :: var_name  !! To store variables names for I/O
1253,1261d1235
<     !Config  Key  = PERCENT_THROUGHFALL_PFT
<     !Config  Desc = Percent by PFT of precip that is not intercepted by the canopy
<     !Config  Def  = 30. 30. 30. 30. 30. 30. 30. 30. 30. 30. 30. 30. 30.
<     !Config  Help = During one rainfall event, PERCENT_THROUGHFALL_PFT% of the incident rainfall
<     !Config         will get directly to the ground without being intercepted, for each PFT.
<     
<     throughfall_by_pft = (/ 30., 30., 30., 30., 30., 30., 30., 30., 30., 30., 30., 30., 30. /)
<     CALL getin_p('PERCENT_THROUGHFALL_PFT',throughfall_by_pft)
<     throughfall_by_pft = throughfall_by_pft / 100.
1418c1392
<        zh(1,jst) = zero
---
>        zz(1,jst) = zero
1421,1423c1395,1397
<           zh(jsl,jst) = dpu(jst)* mille*((2**(jsl-1))-1)/ ((2**(nslm-1))-1)
<           dz(jsl,jst) = zh(jsl,jst)-zh(jsl-1,jst)
<           !          WRITE(numout,*) 'jsl, zz,dz',jsl, dpu(jst),zh(jsl,jst),dz(jsl,jst)
---
>           zz(jsl,jst) = dpu(jst)* mille*((2**(jsl-1))-1)/ ((2**(nslm-1))-1)
>           dz(jsl,jst) = zz(jsl,jst)-zz(jsl-1,jst)
>           !          WRITE(numout,*) 'jsl, zz,dz',jsl, dpu(jst),zz(jsl,jst),dz(jsl,jst)
1425c1399
<        zh(nslm+1,jst) = zh(nslm,jst)
---
>        zz(nslm+1,jst) = zz(nslm,jst)
1630c1604
< !!$          diaglev(jsl) = zh(jsl,1) + dz(jsl+1,1)/deux
---
> !!$          diaglev(jsl) = zz(jsl,1) + dz(jsl+1,1)/deux
1632c1606
< !!$       diaglev(nbdl) = zh(nbdl,1)
---
> !!$       diaglev(nbdl) = zz(nbdl,1)
1920a1895,1911
>     LOGICAL, SAVE                                  :: firstcall=.TRUE.
>     REAL(r_std), SAVE, DIMENSION(nvm)              :: throughfall_by_pft
> 
>     IF ( firstcall ) THEN
>        !Config  Key  = PERCENT_THROUGHFALL_PFT
>        !Config  Desc = Percent by PFT of precip that is not intercepted by the canopy
>        !Config  Def  = 30. 30. 30. 30. 30. 30. 30. 30. 30. 30. 30. 30. 30.
>        !Config  Help = During one rainfall event, PERCENT_THROUGHFALL_PFT% of the incident rainfall
>        !Config         will get directly to the ground without being intercepted, for each PFT.
>        
>        throughfall_by_pft = (/ 30., 30., 30., 30., 30., 30., 30., 30., 30., 30., 30., 30., 30. /)
>        CALL getin_p('PERCENT_THROUGHFALL_PFT',throughfall_by_pft)
>        throughfall_by_pft = throughfall_by_pft / 100.
> 
>        firstcall=.FALSE.
>     ENDIF
> 
2356c2347
<           dpue = zh(nslme(ji,jst),jst) + dz(nslme(ji,jst)+1,jst) / deux
---
>           dpue = zz(nslme(ji,jst),jst) + dz(nslme(ji,jst)+1,jst) / deux
2744c2735
<              dpue = zh(nslme(ji,jst),jst) + dz(nslme(ji,jst)+1,jst) / deux
---
>              dpue = zz(nslme(ji,jst),jst) + dz(nslme(ji,jst)+1,jst) / deux
2793c2784
<           dpue = zh(nslme(ji,jst),jst) + dz(nslme(ji,jst)+1,jst) / deux
---
>           dpue = zz(nslme(ji,jst),jst) + dz(nslme(ji,jst)+1,jst) / deux
2963c2954
<                   & /(un-EXP(-humcste(jv)*zh(nslm,jst)/mille))
---
>                   & /(un-EXP(-humcste(jv)*zz(nslm,jst)/mille))
2976c2967
<                      & (EXP(-humcste(jv)*zh(jsl,jst)/mille)) * &
---
>                      & (EXP(-humcste(jv)*zz(jsl,jst)/mille)) * &
2980c2971
<                      & -EXP(-humcste(jv)*zh(nslm,jst)/mille))
---
>                      & -EXP(-humcste(jv)*zz(nslm,jst)/mille))
2993c2984
<                   & EXP(-humcste(jv)*zh(nslm,jst)/mille) / &
---
>                   & EXP(-humcste(jv)*zz(nslm,jst)/mille) / &
2995c2986
<                   & -EXP(-humcste(jv)*zh(nslm,jst)/mille))
---
>                   & -EXP(-humcste(jv)*zz(nslm,jst)/mille))
diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile /login/IPSL_CODE/AssimilBranche/modeles/ORCHIDEE/src_sechiba/routing.f90 /login/IPSL_CODE/ORCHIDEE_1_9_5_2/modeles/ORCHIDEE/src_sechiba/routing.f90
21c21
< !! @Version : $Revision: 390 $, $Date: 2011-08-09 10:45:55 +0200 (mar. 09 août 2011) $
---
> !! @Version : $Revision: 274 $, $Date: 2011-06-21 15:18:18 +0200 (mar. 21 juin 2011) $
23,24c23,24
< !< $HeadURL: svn://forge.ipsl.jussieu.fr/orchidee/tags/ORCHIDEE_1_9_5_2/ORCHIDEE/src_sechiba/routing.f90 $
< !< $Date: 2011-08-09 10:45:55 +0200 (mar. 09 août 2011) $
---
> !< $HeadURL: svn://forge.ipsl.jussieu.fr/orchidee/trunk/ORCHIDEE/src_sechiba/routing.f90 $
> !< $Date: 2011-06-21 15:18:18 +0200 (mar. 21 juin 2011) $
26c26
< !< $Revision: 390 $
---
> !< $Revision: 274 $
52a53
>   LOGICAL, SAVE                                     :: check_waterbal=.FALSE. !! The check the water balance
141,163d141
< ! List of subroutines for initialization :
< !- routing_init
< !- routing_clear
< !- routing_diagnostic_p
< !- routing_diagnostic
< !- routing_basins_p
< !- routing_basins
< !- routing_getgrid
< !- routing_sortcoord
< !- routing_findbasins
< !- routing_simplify
< !- routing_cutbasin
< !- routing_hierarchy
< !- routing_findrout
< !- routing_globalize
< !- routing_linkup
< !- routing_fetch
< !- routing_truncate
< !- routing_killbas
< !- routing_names
< !- routing_irrigmap
< !- routing_waterbal
< 
167c145
<   SUBROUTINE routing_main(kjit, kjpindex, dtradia, ldrestart_read, ldrestart_write, index, &
---
>   SUBROUTINE routing_main(kjit, nbpt, dtradia, ldrestart_read, ldrestart_write, index, &
187c165
<     INTEGER(i_std), INTENT(in)    :: kjpindex                !! Domain size
---
>     INTEGER(i_std), INTENT(in)    :: nbpt                !! Domain size
193,199c171,177
<     INTEGER(i_std), INTENT(in)    :: index(kjpindex)         ! Indeces of the points on the map 
<     REAL(r_std), INTENT(in)       :: lalo(kjpindex,2)        ! Vector of latitude and longitudes (beware of the order !)
<     INTEGER(i_std), INTENT(in)    :: neighbours(kjpindex,8)  ! Vector of neighbours for each grid point (1=N, 2=E, 3=S, 4=W)
<     REAL(r_std), INTENT(in)       :: resolution(kjpindex,2)  ! The size in km of each grid-box in X and Y
<     REAL(r_std), INTENT(in)       :: contfrac(kjpindex)      ! Fraction of land in each grid box
<     REAL(r_std), INTENT(in)       :: totfrac_nobio(kjpindex) ! Total fraction of continental ice+lakes+...
<     REAL(r_std), INTENT(in)       :: veget_max(kjpindex,nvm) ! Maximum vegetation fraction. We want to have the 
---
>     INTEGER(i_std), INTENT(in)    :: index(nbpt)         ! Indeces of the points on the map 
>     REAL(r_std), INTENT(in)       :: lalo(nbpt,2)        ! Vector of latitude and longitudes (beware of the order !)
>     INTEGER(i_std), INTENT(in)    :: neighbours(nbpt,8)  ! Vector of neighbours for each grid point (1=N, 2=E, 3=S, 4=W)
>     REAL(r_std), INTENT(in)       :: resolution(nbpt,2)  ! The size in km of each grid-box in X and Y
>     REAL(r_std), INTENT(in)       :: contfrac(nbpt)      ! Fraction of land in each grid box
>     REAL(r_std), INTENT(in)       :: totfrac_nobio(nbpt) ! Total fraction of continental ice+lakes+...
>     REAL(r_std), INTENT(in)       :: veget_max(nbpt,nvm) ! Maximum vegetation fraction. We want to have the 
201,211c179,189
<     REAL(r_std), INTENT(in)       :: runoff(kjpindex)        ! grid-point runoff
<     REAL(r_std), INTENT(in)       :: drainage(kjpindex)      ! grid-point drainage
<     REAL(r_std), INTENT(in)       :: evapot(kjpindex)        ! Potential evaporation
<     REAL(r_std), INTENT(in)       :: precip_rain(kjpindex)   ! Rainfall needed for the irrigation formula
<     REAL(r_std), INTENT(in)       :: humrel(kjpindex,nvm)    ! Soil moisture stress
<     REAL(r_std), INTENT(in)       :: stempdiag(kjpindex,nbdl)! Temperature profile in soil
<     !
<     REAL(r_std), INTENT(out)      :: returnflow(kjpindex)    ! The water flow which returns to the grid box (kg/m^2 per dt)
<     REAL(r_std), INTENT(out)      :: irrigation(kjpindex)    ! Irrigation flux (kg/m^2 per dt)
<     REAL(r_std), INTENT(out)      :: riverflow(kjpindex)     ! Outflow of the major rivers
<     REAL(r_std), INTENT(out)      :: coastalflow(kjpindex)   ! Outflow on coastal points by small basins    
---
>     REAL(r_std), INTENT(in)       :: runoff(nbpt)        ! grid-point runoff
>     REAL(r_std), INTENT(in)       :: drainage(nbpt)      ! grid-point drainage
>     REAL(r_std), INTENT(in)       :: evapot(nbpt)        ! Potential evaporation
>     REAL(r_std), INTENT(in)       :: precip_rain(nbpt)   ! Rainfall needed for the irrigation formula
>     REAL(r_std), INTENT(in)       :: humrel(nbpt,nvm)    ! Soil moisture stress
>     REAL(r_std), INTENT(in)       :: stempdiag(nbpt,nbdl)! Temperature profile in soil
>     !
>     REAL(r_std), INTENT(out)      :: returnflow(nbpt)    ! The water flow which returns to the grid box (kg/m^2 per dt)
>     REAL(r_std), INTENT(out)      :: irrigation(nbpt)    ! Irrigation flux (kg/m^2 per dt)
>     REAL(r_std), INTENT(out)      :: riverflow(nbpt)     ! Outflow of the major rivers
>     REAL(r_std), INTENT(out)      :: coastalflow(nbpt)   ! Outflow on coastal points by small basins    
217c195
<     REAL(r_std), DIMENSION(kjpindex)  :: return_lakes
---
>     REAL(r_std), DIMENSION(nbpt)  :: return_lakes
228c206
<        CALL routing_init (kjit, kjpindex, index, dtradia, returnflow, irrigation, &
---
>        CALL routing_init (kjit, nbpt, index, dtradia, returnflow, irrigation, &
240c218
<           CALL routing_basins_p(kjpindex, lalo, neighbours, resolution, contfrac)
---
>           CALL routing_basins_p(nbpt, lalo, neighbours, resolution, contfrac)
260c238
<              CALL routing_irrigmap(kjpindex, index, lalo, neighbours, resolution, &
---
>              CALL routing_irrigmap(nbpt, index, lalo, neighbours, resolution, &
268c246
<        CALL routing_diagnostic_p(kjpindex, index, resolution, contfrac, hist_id, hist2_id)
---
>        CALL routing_diagnostic_p(nbpt, index, resolution, contfrac, hist_id, hist2_id)
293c271
<        DO ig=1,kjpindex
---
>        DO ig=1,nbpt
308c286
<           CALL routing_waterbal(kjpindex, .TRUE., runoff_mean, drainage_mean, returnflow_mean, &
---
>           CALL routing_waterbal(nbpt, .TRUE., runoff_mean, drainage_mean, returnflow_mean, &
314c292
<        DO ig=1,kjpindex
---
>        DO ig=1,nbpt
320c298
<        CALL routing_flow(kjpindex, dt_routing, runoff_mean, drainage_mean, &
---
>        CALL routing_flow(nbpt, dt_routing, runoff_mean, drainage_mean, &
325c303
<        CALL routing_lake(kjpindex, dt_routing, lakeinflow_mean, humrel_mean, return_lakes)
---
>        CALL routing_lake(nbpt, dt_routing, lakeinflow_mean, humrel_mean, return_lakes)
332c310
<           CALL routing_waterbal(kjpindex, .FALSE., runoff_mean, drainage_mean, returnflow_mean, &
---
>           CALL routing_waterbal(nbpt, .FALSE., runoff_mean, drainage_mean, returnflow_mean, &
454,455c432,433
<        CALL histwrite(hist_id, 'riversret', kjit, returnflow, kjpindex, index)
<        CALL histwrite(hist_id, 'hydrographs', kjit, hydrographs, kjpindex, index)
---
>        CALL histwrite(hist_id, 'riversret', kjit, returnflow, nbpt, index)
>        CALL histwrite(hist_id, 'hydrographs', kjit, hydrographs, nbpt, index)
457,460c435,438
<        CALL histwrite(hist_id, 'fastr', kjit, fast_diag, kjpindex, index)
<        CALL histwrite(hist_id, 'slowr', kjit, slow_diag, kjpindex, index)
<        CALL histwrite(hist_id, 'streamr', kjit, stream_diag, kjpindex, index)
<        CALL histwrite(hist_id, 'lakevol', kjit, lake_diag, kjpindex, index)
---
>        CALL histwrite(hist_id, 'fastr', kjit, fast_diag, nbpt, index)
>        CALL histwrite(hist_id, 'slowr', kjit, slow_diag, nbpt, index)
>        CALL histwrite(hist_id, 'streamr', kjit, stream_diag, nbpt, index)
>        CALL histwrite(hist_id, 'lakevol', kjit, lake_diag, nbpt, index)
462c440
<        CALL histwrite(hist_id, 'irrigation', kjit, irrigation, kjpindex, index)
---
>        CALL histwrite(hist_id, 'irrigation', kjit, irrigation, nbpt, index)
464c442
<        CALL histwrite(hist_id, 'netirrig', kjit, irrig_netereq, kjpindex, index)
---
>        CALL histwrite(hist_id, 'netirrig', kjit, irrig_netereq, nbpt, index)
468c446
<        CALL histwrite(hist_id, 'dis', kjit, hydrographs, kjpindex, index)
---
>        CALL histwrite(hist_id, 'dis', kjit, hydrographs, nbpt, index)
474,475c452,453
<           CALL histwrite(hist2_id, 'riversret', kjit, returnflow, kjpindex, index)
<           CALL histwrite(hist2_id, 'hydrographs', kjit, hydrographs, kjpindex, index)
---
>           CALL histwrite(hist2_id, 'riversret', kjit, returnflow, nbpt, index)
>           CALL histwrite(hist2_id, 'hydrographs', kjit, hydrographs, nbpt, index)
477,480c455,458
<           CALL histwrite(hist2_id, 'fastr', kjit, fast_diag, kjpindex, index)
<           CALL histwrite(hist2_id, 'slowr', kjit, slow_diag, kjpindex, index)
<           CALL histwrite(hist2_id, 'streamr', kjit, stream_diag, kjpindex, index)
<           CALL histwrite(hist2_id, 'lakevol', kjit, lake_diag, kjpindex, index)
---
>           CALL histwrite(hist2_id, 'fastr', kjit, fast_diag, nbpt, index)
>           CALL histwrite(hist2_id, 'slowr', kjit, slow_diag, nbpt, index)
>           CALL histwrite(hist2_id, 'streamr', kjit, stream_diag, nbpt, index)
>           CALL histwrite(hist2_id, 'lakevol', kjit, lake_diag, nbpt, index)
482c460
<           CALL histwrite(hist2_id, 'irrigation', kjit, irrigation, kjpindex, index)
---
>           CALL histwrite(hist2_id, 'irrigation', kjit, irrigation, nbpt, index)
484c462
<           CALL histwrite(hist2_id, 'netirrig', kjit, irrig_netereq, kjpindex, index)
---
>           CALL histwrite(hist2_id, 'netirrig', kjit, irrig_netereq, nbpt, index)
488c466
<           CALL histwrite(hist2_id, 'dis', kjit, hydrographs, kjpindex, index)
---
>           CALL histwrite(hist2_id, 'dis', kjit, hydrographs, nbpt, index)
diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile /login/IPSL_CODE/AssimilBranche/modeles/ORCHIDEE/src_sechiba/sechiba.f90 /login/IPSL_CODE/ORCHIDEE_1_9_5_2/modeles/ORCHIDEE/src_sechiba/sechiba.f90
8c8
< !< $HeadURL: svn://forge.ipsl.jussieu.fr/orchidee/tags/ORCHIDEE_1_9_5_2/ORCHIDEE/src_sechiba/sechiba.f90 $
---
> !< $HeadURL: svn://forge.ipsl.jussieu.fr/orchidee/trunk/ORCHIDEE/src_sechiba/sechiba.f90 $
89d88
<   REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:)    :: t2mdiag_min    !! 2 meter temperature min over time step
134a134
>   CHARACTER(LEN=80) , SAVE                             :: var_name                !! To store variables names for I/O
138,139d137
<   LOGICAL, SAVE                                   :: ldforcing_write  !! Logical for _forcing_ file to write
<   LOGICAL, SAVE                                   :: ldcarbon_write   !! Logical for _carbon_forcing_ file to w
145,148d142
< ! List of subroutines for initialization :
< !- sechiba_init
< !- sechiba_clear
< 
267d260
<     CHARACTER(LEN=80)                                  :: var_name         !! To store variables names for I/O
318,320c311
<        !
<        ldforcing_write=control%ok_co2
<        ldcarbon_write=control%ok_stomate
---
> 
325c316
<             ldrestart_read, ldrestart_write, ldforcing_write, ldcarbon_write, &
---
>             ldrestart_read, ldrestart_write, control%ok_co2, control%ok_stomate, &
327c318
<             t2mdiag, t2mdiag_min, temp_sol, stempdiag, &
---
>             t2mdiag, t2mdiag, temp_sol, stempdiag, &
516d506
<     t2mdiag_min = t2mdiag
578c568
<          ldrestart_read, ldrestart_write, ldforcing_write, ldcarbon_write, &
---
>          ldrestart_read, myfalse, control%ok_co2, control%ok_stomate, &
580c570
<          t2mdiag, t2mdiag_min, temp_sol, stempdiag, &
---
>          t2mdiag, t2mdiag, temp_sol, stempdiag, &
770c760
<        t2mdiag_min = t2mdiag
---
> 
827c817
<             ldrestart_read, ldrestart_write, ldforcing_write, ldcarbon_write, &
---
>             ldrestart_read, ldrestart_write, control%ok_co2, control%ok_stomate, &
829c819
<             t2mdiag, t2mdiag_min, temp_sol, stempdiag, &
---
>             t2mdiag, t2mdiag, temp_sol, stempdiag, &
877d866
<     CHARACTER(LEN=80)                             :: var_name         !! To store variables names for I/O
1168,1173d1156
<     ALLOCATE (t2mdiag_min(kjpindex),stat=ier)
<     IF (ier.NE.0) THEN
<        WRITE (numout,*) ' error in t2mdiag_min allocation. We stop. We need kjpindex words = ',kjpindex
<        STOP 'sechiba_init'
<     END IF
< 
1434d1416
<     IF ( ALLOCATED (albedo)) DEALLOCATE (albedo)
1441d1422
<     IF ( ALLOCATED (t2mdiag_min)) DEALLOCATE (t2mdiag_min)
1447,1448d1427
<     IF ( ALLOCATED (z0)) DEALLOCATE (z0)
<     IF ( ALLOCATED (emis)) DEALLOCATE (emis)
diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile /login/IPSL_CODE/AssimilBranche/modeles/ORCHIDEE/src_sechiba/sechiba_io_p.f90 /login/IPSL_CODE/ORCHIDEE_1_9_5_2/modeles/ORCHIDEE/src_sechiba/sechiba_io_p.f90
14c14
< !< $HeadURL: svn://forge.ipsl.jussieu.fr/orchidee/tags/ORCHIDEE_1_9_5_2/ORCHIDEE/src_sechiba/sechiba_io_p.f90 $
---
> !< $HeadURL: svn://forge.ipsl.jussieu.fr/orchidee/trunk/ORCHIDEE/src_sechiba/sechiba_io_p.f90 $
46,47d45
< ! List of subroutines for initialization :
< !- ok_var
diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile /login/IPSL_CODE/AssimilBranche/modeles/ORCHIDEE/src_sechiba/slowproc.f90 /login/IPSL_CODE/ORCHIDEE_1_9_5_2/modeles/ORCHIDEE/src_sechiba/slowproc.f90
4c4
< !< $HeadURL: svn://forge.ipsl.jussieu.fr/orchidee/tags/ORCHIDEE_1_9_5_2/ORCHIDEE/src_sechiba/slowproc.f90 $
---
> !< $HeadURL: svn://forge.ipsl.jussieu.fr/orchidee/trunk/ORCHIDEE/src_sechiba/slowproc.f90 $
68,70c68,70
<   REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:,:)    :: veget_max_new          !! next year fraction of vegetation type
<   REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:,:)    :: frac_nobio_new     !! next year fraction of ice+lakes+cities+...
<   REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:)      :: totfrac_nobio_new  !! next year total fraction of ice+lakes+cities+...
---
>   REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:,:)    :: veget_nextyear          !! next year fraction of vegetation type
>   REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:,:)    :: frac_nobio_nextyear     !! next year fraction of ice+lakes+cities+...
>   REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:)      :: totfrac_nobio_nextyear  !! next year total fraction of ice+lakes+cities+...
73,87d72
< ! List of subroutines for initialization :
< !- slowproc_init
< !- slowproc_clear
< !- slowproc_derivvar
< !- slowproc_veget
< !- slowproc_lai
< !- slowproc_interlai_OLD
< !- slowproc_interlai_NEW
< !- slowproc_update
< !- slowproc_interpol_OLD
< !- slowproc_interpol_NEW
< !- slowproc_interpol_OLD_g
< !- slowproc_interpol_NEW_g
< !- slowproc_nearest
< !- slowproc_soilt
91,92c76,77
<        index, indexveg, lalo, neighbours, resolution, contfrac, soiltype, &
<        t2m, t2mdiag, temp_sol, stempdiag, &
---
>        IndexLand, indexveg, lalo, neighbours, resolution, contfrac, soiltype, &
>        t2m, t2m_min, temp_sol, stempdiag, &
118c103
<     INTEGER(i_std),DIMENSION (kjpindex), INTENT (in)    :: index         !! Indeces of the points on the map
---
>     INTEGER(i_std),DIMENSION (kjpindex), INTENT (in)    :: IndexLand         !! Indeces of the points on the map
126c111
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)        :: t2mdiag          !! min. 2 m air temp. during forcing time step (K)
---
>     REAL(r_std), DIMENSION(kjpindex), INTENT(in)        :: t2m_min          !! min. 2 m air temp. during forcing time step (K)
179c164
<        CALL slowproc_init (kjit, ldrestart_read, dtradia, date0, kjpindex, index, lalo, neighbours, resolution, contfrac, &
---
>        CALL slowproc_init (kjit, ldrestart_read, dtradia, date0, kjpindex, IndexLand, lalo, neighbours, resolution, contfrac, &
198d182
< 
204,205c188,189
<                index, lalo, neighbours, resolution, contfrac, totfrac_nobio, clayfraction, &
<                t2m, t2mdiag, temp_sol, stempdiag, &
---
>                IndexLand, lalo, neighbours, resolution, contfrac, totfrac_nobio, clayfraction, &
>                t2m, t2m_min, temp_sol, stempdiag, &
210c194
<                veget_max_new, totfrac_nobio_new, &
---
>                veget_nextyear, totfrac_nobio_nextyear, &
300,301c284,285
<                index, lalo, neighbours, resolution, contfrac, totfrac_nobio, clayfraction, &
<                t2m, t2mdiag, temp_sol, stempdiag, &
---
>                IndexLand, lalo, neighbours, resolution, contfrac, totfrac_nobio, clayfraction, &
>                t2m, t2m_min, temp_sol, stempdiag, &
306c290
<                veget_max_new, totfrac_nobio_new, &
---
>                veget_nextyear, totfrac_nobio_nextyear, &
371c355
<                &               veget_max, frac_nobio, veget_max_new, frac_nobio_new, veget_year)
---
>                &               veget_max, frac_nobio, veget_nextyear, frac_nobio_nextyear, veget_year)
374,375c358,359
<              WHERE(veget_max_new(:,:).LT.veget(:,:))
<                 veget(:,:) = veget_max_new(:,:)
---
>              WHERE(veget_nextyear(:,:).LT.veget(:,:))
>                 veget(:,:) = veget_nextyear(:,:)
379c363
<                 totfrac_nobio_new(:) = totfrac_nobio_new(:) + frac_nobio_new(:,j)
---
>                 totfrac_nobio_nextyear(:) = totfrac_nobio_nextyear(:) + frac_nobio_nextyear(:,j)
398,399c382,383
<             index, lalo, neighbours, resolution, contfrac, totfrac_nobio, clayfraction, &
<             t2m, t2mdiag, temp_sol, stempdiag, &
---
>             IndexLand, lalo, neighbours, resolution, contfrac, totfrac_nobio, clayfraction, &
>             t2m, t2m_min, temp_sol, stempdiag, &
404c388
<             veget_max_new, totfrac_nobio_new, &
---
>             veget_nextyear, totfrac_nobio_nextyear, &
448,449c432,433
<              veget_max(:,:)=veget_max_new(:,:)
<              frac_nobio(:,:)=frac_nobio_new(:,:)
---
>              veget_max(:,:)=veget_nextyear(:,:)
>              frac_nobio(:,:)=frac_nobio_nextyear(:,:)
465c449
<              frac_nobio(:,:)=frac_nobio_new(:,:)
---
>              frac_nobio(:,:)=frac_nobio_nextyear(:,:)
552c536
<     ALLOCATE(veget_max_new(kjpindex, nvm), STAT=ier)
---
>     ALLOCATE(veget_nextyear(kjpindex, nvm), STAT=ier)
554c538
<       WRITE(numout,*) "ERROR IN ALLOCATION of veget_max_new : ",ier
---
>       WRITE(numout,*) "ERROR IN ALLOCATION of veget_nextyear : ",ier
557,558c541,542
<     veget_max_new(:,1) = un
<     veget_max_new(:,2:nvm) = zero
---
>     veget_nextyear(:,1) = un
>     veget_nextyear(:,2:nvm) = zero
561c545
<     ALLOCATE(frac_nobio_new(kjpindex, nnobio), STAT=ier)
---
>     ALLOCATE(frac_nobio_nextyear(kjpindex, nnobio), STAT=ier)
563c547
<       PRINT *,"ERROR IN ALLOCATION of frac_nobio_new : ",ier
---
>       PRINT *,"ERROR IN ALLOCATION of frac_nobio_nextyear : ",ier
566c550
<     frac_nobio_new(:,:) = zero
---
>     frac_nobio_nextyear(:,:) = zero
569c553
<     ALLOCATE(totfrac_nobio_new(kjpindex), STAT=ier)
---
>     ALLOCATE(totfrac_nobio_nextyear(kjpindex), STAT=ier)
571c555
<       PRINT *,"ERROR IN ALLOCATION of totfrac_nobio_new : ",ier
---
>       PRINT *,"ERROR IN ALLOCATION of totfrac_nobio_nextyear : ",ier
575c559
<     totfrac_nobio_new(:) = nnobio*un
---
>     totfrac_nobio_nextyear(:) = nnobio*un
1036c1020
<                &               veget_max_new, frac_nobio_new, veget_max, frac_nobio, veget_year, init=.TRUE.)
---
>                &               veget_nextyear, frac_nobio_nextyear, veget_max, frac_nobio, veget_year, init=.TRUE.)
1224,1226c1208,1210
<     IF (ALLOCATED (veget_max_new)) DEALLOCATE (veget_max_new)
<     IF (ALLOCATED (frac_nobio_new)) DEALLOCATE (frac_nobio_new)
<     IF (ALLOCATED (totfrac_nobio_new)) DEALLOCATE (totfrac_nobio_new)
---
>     IF (ALLOCATED (veget_nextyear)) DEALLOCATE (veget_nextyear)
>     IF (ALLOCATED (frac_nobio_nextyear)) DEALLOCATE (frac_nobio_nextyear)
>     IF (ALLOCATED (totfrac_nobio_nextyear)) DEALLOCATE (totfrac_nobio_nextyear)
diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile /login/IPSL_CODE/AssimilBranche/modeles/ORCHIDEE/src_sechiba/thermosoil.f90 /login/IPSL_CODE/ORCHIDEE_1_9_5_2/modeles/ORCHIDEE/src_sechiba/thermosoil.f90
7c7
< !< $HeadURL: svn://forge.ipsl.jussieu.fr/orchidee/tags/ORCHIDEE_1_9_5_2/ORCHIDEE/src_sechiba/thermosoil.f90 $
---
> !< $HeadURL: svn://forge.ipsl.jussieu.fr/orchidee/trunk/ORCHIDEE/src_sechiba/thermosoil.f90 $
38a39
>   CHARACTER(LEN=80) , SAVE                  :: var_name                  !! To store variables names for I/O
74,82d74
< ! List of subroutines for initialization :
< !- thermosoil_init
< !- thermosoil_clear
< !- fz
< !- thermosoil_var_init
< !- thermosoil_coef
< !- thermosoil_diaglev
< !- thermosoil_humlev
< !- thermosoil_energy
121d112
<     CHARACTER(LEN=80)                :: var_name                  !! To store variables names for I/O
354d344
<     CHARACTER(LEN=80)                :: var_name                  !! To store variables names for I/O
diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile /login/IPSL_CODE/AssimilBranche/modeles/ORCHIDEE/src_sechiba/watchout.f90 /login/IPSL_CODE/ORCHIDEE_1_9_5_2/modeles/ORCHIDEE/src_sechiba/watchout.f90
8,9d7
<   IMPLICIT NONE
< 
51,56d48
< ! List of subroutines for initialization :
< !- watchout_init
< !- watchout_write_p
< !- watchout_write
< !- watchout_close
< 
diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile /login/IPSL_CODE/AssimilBranche/modeles/ORCHIDEE/src_stomate/lpj_constraints.f90 /login/IPSL_CODE/ORCHIDEE_1_9_5_2/modeles/ORCHIDEE/src_stomate/lpj_constraints.f90
23c23
<   LOGICAL, SAVE                                    :: firstcall_constraints = .TRUE.
---
>   LOGICAL, SAVE                                    :: firstcall = .TRUE.
25,27d24
< ! List of subroutines for initialization :
< !- constraints_clear
< 
31c28
<     firstcall_constraints = .TRUE. 
---
>     firstcall = .TRUE. 
34c31
<   SUBROUTINE constraints_main (kjpindex, dt_days, &
---
>   SUBROUTINE constraints (npts, dt, &
45c42
<     INTEGER(i_std), INTENT(in)                              :: kjpindex
---
>     INTEGER(i_std), INTENT(in)                              :: npts
47c44
<     REAL(r_std), INTENT(in)                           :: dt_days
---
>     REAL(r_std), INTENT(in)                           :: dt
49c46
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)          :: t2m_month
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)          :: t2m_month
51c48
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)          :: t2m_min_daily
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)          :: t2m_min_daily
53c50
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)     :: when_growthinit
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)     :: when_growthinit
58c55
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)  :: adapted
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)  :: adapted
60c57
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)  :: regenerate
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)  :: regenerate
65c62
<     REAL(r_std), SAVE                                 :: tau_adapt
---
>     REAL(r_std)                                       :: tau_adapt
67c64
<     REAL(r_std), SAVE                                 :: tau_regenerate 
---
>     REAL(r_std)                                       :: tau_regenerate 
79,80d75
<     IF ( firstcall_constraints ) THEN
< 
89a85,86
>     IF ( firstcall ) THEN
> 
98,99c95,96
<        firstcall_constraints = .FALSE.
<        RETURN
---
>        firstcall = .FALSE.
> 
141c138
<              adapted(:,j) = un - ( un - adapted(:,j) ) * (tau_adapt- dt_days)/tau_adapt
---
>              adapted(:,j) = un - ( un - adapted(:,j) ) * (tau_adapt- dt)/tau_adapt
179c176
<              regenerate(:,j) = regenerate(:,j) * (tau_regenerate-dt_days)/tau_regenerate
---
>              regenerate(:,j) = regenerate(:,j) * (tau_regenerate-dt)/tau_regenerate
205c202
<          adapted, kjpindex*nvm, horipft_index)
---
>          adapted, npts*nvm, horipft_index)
207c204
<          regenerate, kjpindex*nvm, horipft_index)
---
>          regenerate, npts*nvm, horipft_index)
211c208
<   END SUBROUTINE constraints_main
---
>   END SUBROUTINE constraints
diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile /login/IPSL_CODE/AssimilBranche/modeles/ORCHIDEE/src_stomate/lpj_cover.f90 /login/IPSL_CODE/ORCHIDEE_1_9_5_2/modeles/ORCHIDEE/src_stomate/lpj_cover.f90
24c24
<   SUBROUTINE cover (kjpindex, cn_ind, ind, biomass, &
---
>   SUBROUTINE cover (npts, cn_ind, ind, biomass, &
34c34
<     INTEGER(i_std), INTENT(in)                                   :: kjpindex
---
>     INTEGER(i_std), INTENT(in)                                   :: npts
36c36
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)          :: cn_ind
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)          :: cn_ind
38c38
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)          :: ind
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)          :: ind
40c40
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)          :: veget_max_old
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)          :: veget_max_old
44c44
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts), INTENT(inout)   :: biomass
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(inout)   :: biomass
46c46
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)       :: veget_max
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)       :: veget_max
48c48
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts), INTENT(inout)          :: turnover_daily
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(inout)          :: turnover_daily
50c50
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts), INTENT(inout)          :: bm_to_litter
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(inout)          :: bm_to_litter
55c55
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)       :: veget
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)       :: veget
57c57
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)         :: lai
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)         :: lai
60c60
<     REAL(r_std),DIMENSION(kjpindex,nlitt,nvm,nlevs), INTENT(inout)         :: litter
---
>     REAL(r_std),DIMENSION(npts,nlitt,nvm,nlevs), INTENT(inout)         :: litter
62c62
<     REAL(r_std),DIMENSION(kjpindex,ncarb,nvm), INTENT(inout)               :: carbon
---
>     REAL(r_std),DIMENSION(npts,ncarb,nvm), INTENT(inout)               :: carbon
70c70
<     REAL(r_std),DIMENSION(kjpindex,nlitt,nlevs)                            :: dilu_lit
---
>     REAL(r_std),DIMENSION(npts,nlitt,nlevs)                            :: dilu_lit
72c72
<     REAL(r_std),DIMENSION(kjpindex,ncarb)                                  :: dilu_soil_carbon
---
>     REAL(r_std),DIMENSION(npts,ncarb)                                  :: dilu_soil_carbon
78,79c78,79
<     REAL(r_std), DIMENSION(kjpindex)                                       :: frac_nat,sum_vegettree,sum_vegetgrass
<     REAL(r_std), DIMENSION(kjpindex)                                       :: sum_veget_natveg
---
>     REAL(r_std), DIMENSION(npts)                                       :: frac_nat,sum_vegettree,sum_vegetgrass
>     REAL(r_std), DIMENSION(npts)                                       :: sum_veget_natveg
114c114
<        DO i = 1, kjpindex 
---
>        DO i = 1, npts 
135c135
<        DO i = 1, kjpindex         
---
>        DO i = 1, npts         
195c195
<        DO i = 1, kjpindex
---
>        DO i = 1, npts
237c237
<        DO i = 1,kjpindex
---
>        DO i = 1,npts
diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile /login/IPSL_CODE/AssimilBranche/modeles/ORCHIDEE/src_stomate/lpj_crown.f90 /login/IPSL_CODE/ORCHIDEE_1_9_5_2/modeles/ORCHIDEE/src_stomate/lpj_crown.f90
29c29
<        &  (kjpindex, PFTpresent, ind, biomass, woodmass_ind, veget_max, cn_ind, height)
---
>        &  (npts, PFTpresent, ind, biomass, woodmass_ind, veget_max, cn_ind, height)
36c36
<     INTEGER(i_std),INTENT(in) :: kjpindex
---
>     INTEGER(i_std),INTENT(in) :: npts
38c38
<     LOGICAL,DIMENSION(kjpindex,nvm),INTENT(in) :: PFTpresent
---
>     LOGICAL,DIMENSION(npts,nvm),INTENT(in) :: PFTpresent
40c40
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: ind
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: ind
42c42
<     REAL(r_std),DIMENSION(kjpindex,nvm,nparts),INTENT(in) :: biomass
---
>     REAL(r_std),DIMENSION(npts,nvm,nparts),INTENT(in) :: biomass
44c44
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: woodmass_ind
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: woodmass_ind
50c50
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(inout) :: veget_max
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(inout) :: veget_max
56c56
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: cn_ind
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out) :: cn_ind
60c60
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(inout) :: height
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(inout) :: height
66c66
< !!$    REAL(r_std),DIMENSION(kjpindex) :: woodmass
---
> !!$    REAL(r_std),DIMENSION(npts) :: woodmass
74c74
<     REAL(r_std),DIMENSION(kjpindex) :: dia
---
>     REAL(r_std),DIMENSION(npts) :: dia
diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile /login/IPSL_CODE/AssimilBranche/modeles/ORCHIDEE/src_stomate/lpj_establish.f90 /login/IPSL_CODE/ORCHIDEE_1_9_5_2/modeles/ORCHIDEE/src_stomate/lpj_establish.f90
21c21
<   PUBLIC establish_main,establish_clear
---
>   PUBLIC establish,establish_clear
24c24
<   LOGICAL, SAVE                                              :: firstcall_establish = .TRUE.
---
>   LOGICAL, SAVE                                              :: firstcall = .TRUE.
26,28d25
< ! List of subroutines for initialization :
< !- establish_clear
< 
32c29
<     firstcall_establish = .TRUE.
---
>     firstcall = .TRUE.
35c32
<   SUBROUTINE establish_main (kjpindex, dt_days, PFTpresent, regenerate, &
---
>   SUBROUTINE establish (npts, dt, PFTpresent, regenerate, &
37c34
<        precip_lastyear, gdd0_lastyear, lm_lastyearmax, &
---
>        precip_annual, gdd0, lm_lastyearmax, &
40c37
<        ind, biomass, age, everywhere, co2_to_bm_dgvm,veget_max, woodmass_ind)
---
>        ind, biomass, age, everywhere, co2_to_bm,veget_max, woodmass_ind)
48c45
<     INTEGER(i_std), INTENT(in)                                  :: kjpindex
---
>     INTEGER(i_std), INTENT(in)                                  :: npts
50c47
<     REAL(r_std), INTENT(in)                                     :: dt_days
---
>     REAL(r_std), INTENT(in)                                     :: dt
52c49
<     LOGICAL, DIMENSION(kjpindex,nvm), INTENT(in)                  :: PFTpresent
---
>     LOGICAL, DIMENSION(npts,nvm), INTENT(in)                  :: PFTpresent
54c51
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)               :: regenerate
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)               :: regenerate
56c53
<     INTEGER(i_std), DIMENSION(kjpindex,8), INTENT(in)               :: neighbours
---
>     INTEGER(i_std), DIMENSION(npts,8), INTENT(in)               :: neighbours
58c55
<     REAL(r_std), DIMENSION(kjpindex,2), INTENT(in)                  :: resolution
---
>     REAL(r_std), DIMENSION(npts,2), INTENT(in)                  :: resolution
61c58
<     LOGICAL, DIMENSION(kjpindex,nvm), INTENT(in)                  :: need_adjacent
---
>     LOGICAL, DIMENSION(npts,nvm), INTENT(in)                  :: need_adjacent
63c60
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)               :: herbivores
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)               :: herbivores
65c62
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                    :: precip_lastyear
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                    :: precip_annual
67c64
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                    :: gdd0_lastyear
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                    :: gdd0
69c66
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)               :: lm_lastyearmax
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)               :: lm_lastyearmax
71c68
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)               :: cn_ind
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)               :: cn_ind
73c70
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)               :: lai
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)               :: lai
75c72
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                    :: avail_tree
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                    :: avail_tree
77c74
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                    :: avail_grass
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                    :: avail_grass
79c76
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)                :: npp_longterm
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)                :: npp_longterm
81c78
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)            :: veget_max
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)            :: veget_max
86c83
<     REAL(r_std), DIMENSION(kjpindex,nvm,nleafages), INTENT(inout)  :: leaf_age
---
>     REAL(r_std), DIMENSION(npts,nvm,nleafages), INTENT(inout)  :: leaf_age
88c85
<     REAL(r_std), DIMENSION(kjpindex,nvm,nleafages), INTENT(inout)  :: leaf_frac
---
>     REAL(r_std), DIMENSION(npts,nvm,nleafages), INTENT(inout)  :: leaf_frac
90c87
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)            :: ind
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)            :: ind
92c89
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts), INTENT(inout)     :: biomass
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(inout)     :: biomass
94c91
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)            :: age
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)            :: age
96c93
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)            :: everywhere
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)            :: everywhere
99c96
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)                 :: co2_to_bm_dgvm
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)                 :: co2_to_bm
101c98
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)                 :: woodmass_ind
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)                 :: woodmass_ind
106c103
<     REAL(r_std), SAVE                                           :: tau_eatup 
---
>     REAL(r_std)                                                 :: tau_eatup 
108c105
<     REAL(r_std), DIMENSION(kjpindex,nvm)                            :: fpc_nat
---
>     REAL(r_std), DIMENSION(npts,nvm)                           :: fpc_nat
110c107
<     REAL(r_std), DIMENSION(kjpindex)                                :: estab_rate_max_climate_tree
---
>     REAL(r_std), DIMENSION(npts)                                :: estab_rate_max_climate_tree
112c109
<     REAL(r_std), DIMENSION(kjpindex)                                :: estab_rate_max_climate_grass
---
>     REAL(r_std), DIMENSION(npts)                                :: estab_rate_max_climate_grass
114c111
<     REAL(r_std), DIMENSION(kjpindex)                                :: estab_rate_max_tree
---
>     REAL(r_std), DIMENSION(npts)                                :: estab_rate_max_tree
116c113
<     REAL(r_std), DIMENSION(kjpindex)                                :: estab_rate_max_grass
---
>     REAL(r_std), DIMENSION(npts)                                :: estab_rate_max_grass
118c115
<     REAL(r_std), DIMENSION(kjpindex)                                :: sumfpc
---
>     REAL(r_std), DIMENSION(npts)                                :: sumfpc
120c117
<     REAL(r_std), DIMENSION(kjpindex)                                :: fracnat
---
>     REAL(r_std), DIMENSION(npts)                                :: fracnat
122c119
<     REAL(r_std), DIMENSION(kjpindex)                                :: sumfpc_wood
---
>     REAL(r_std), DIMENSION(npts)                                :: sumfpc_wood
124c121
<     REAL(r_std), DIMENSION(kjpindex)                                :: spacefight_tree
---
>     REAL(r_std), DIMENSION(npts)                                :: spacefight_tree
126c123
<     REAL(r_std), DIMENSION(kjpindex)                                :: spacefight_grass
---
>     REAL(r_std), DIMENSION(npts)                                :: spacefight_grass
128c125
<     REAL(r_std), DIMENSION(kjpindex,nvm)                           :: d_ind
---
>     REAL(r_std), DIMENSION(npts,nvm)                           :: d_ind
130c127
<     REAL(r_std), DIMENSION(kjpindex)                                :: bm_new
---
>     REAL(r_std), DIMENSION(npts)                                :: bm_new
132c129
<     REAL(r_std), DIMENSION(kjpindex)                                :: dia
---
>     REAL(r_std), DIMENSION(npts)                                :: dia
134c131
<     REAL(r_std), DIMENSION(kjpindex)                                :: b1
---
>     REAL(r_std), DIMENSION(npts)                                :: b1
136c133
<     REAL(r_std), DIMENSION(kjpindex)                                :: sm2
---
>     REAL(r_std), DIMENSION(npts)                                :: sm2
138c135
<     REAL(r_std), DIMENSION(kjpindex)                                :: woodmass
---
>     REAL(r_std), DIMENSION(npts)                                :: woodmass
140c137
<     REAL(r_std), DIMENSION(kjpindex)                                :: leaf_mass_young
---
>     REAL(r_std), DIMENSION(npts)                                :: leaf_mass_young
142c139
<     REAL(r_std), DIMENSION(kjpindex)                                :: sm_at
---
>     REAL(r_std), DIMENSION(npts)                                :: sm_at
144c141
<     REAL(r_std), DIMENSION(kjpindex)                                :: factor
---
>     REAL(r_std), DIMENSION(npts)                                :: factor
146c143
<     REAL(r_std), DIMENSION(kjpindex)                                :: total_bm_c
---
>     REAL(r_std), DIMENSION(npts)                                :: total_bm_c
148c145
<     REAL(r_std), DIMENSION(kjpindex)                                :: total_bm_sapl
---
>     REAL(r_std), DIMENSION(npts)                                :: total_bm_sapl
153c150
<     !LOGICAL, DIMENSION(kjpindex)                                   :: many_new
---
>     !LOGICAL, DIMENSION(npts)                                   :: many_new
156c153
<     REAL(r_std), DIMENSION(kjpindex)                                 :: vn
---
>     REAL(r_std), DIMENSION(npts)                                 :: vn
158c155
<     REAL(r_std), DIMENSION(kjpindex)                                 :: lai_ind
---
>     REAL(r_std), DIMENSION(npts)                                 :: lai_ind
167,168d163
<     IF ( firstcall_establish ) THEN
< 
173a169,170
>     IF ( firstcall ) THEN
> 
179,180c176,177
<        firstcall_establish = .FALSE.
<        RETURN
---
>        firstcall = .FALSE.
> 
284c281
<        WHERE ( ( precip_lastyear(:) .GE. precip_crit ) .AND. ( gdd0_lastyear(:) .GE. gdd_crit ) )
---
>        WHERE ( ( precip_annual(:) .GE. precip_crit ) .AND. ( gdd0(:) .GE. gdd_crit ) )
364c361
<                 DO i = 1, kjpindex
---
>                 DO i = 1, npts
392c389
<                            everywhere(i,j) + migrate(j) * dt_days/one_year * &
---
>                            everywhere(i,j) + migrate(j) * dt/one_year * &
401c398
<                               everywhere(i,j) + migrate(j) * dt_days/one_year * &
---
>                               everywhere(i,j) + migrate(j) * dt/one_year * &
430c427
<                         avail_tree(:) * dt_days/one_year
---
>                         avail_tree(:) * dt/one_year
442c439
<                         MAX(min_stomate,npp_longterm(:,j)*lm_lastyearmax(:,j)*sla(j)/factor(:)) * fracnat(:) * dt_days/one_year
---
>                         MAX(min_stomate,npp_longterm(:,j)*lm_lastyearmax(:,j)*sla(j)/factor(:)) * fracnat(:) * dt/one_year
488c485
<                 d_ind(:,j) = MAX( 0.0, estab_rate_max_tree(:) * dt_days/one_year)
---
>                 d_ind(:,j) = MAX( 0.0, estab_rate_max_tree(:) * dt/one_year)
494c491
<              !d_ind(:,j) = 0.1 !MAX( 0.0, estab_rate_max_tree(:) * dt_days/one_year)
---
>              !d_ind(:,j) = 0.1 !MAX( 0.0, estab_rate_max_tree(:) * dt/one_year)
509c506
<                 d_ind(:,j) = MAX(0.0 , (1.0-fpc_nat(:,j)) * dt_days/one_year )
---
>                 d_ind(:,j) = MAX(0.0 , (1.0-fpc_nat(:,j)) * dt/one_year )
601c598
<                 DO i=1,kjpindex
---
>                 DO i=1,npts
633c630
<              DO i=1,kjpindex
---
>              DO i=1,npts
683c680
<                 co2_to_bm_dgvm(:,j) = co2_to_bm_dgvm(:,j) + bm_new(:) / dt_days
---
>                 co2_to_bm(:,j) = co2_to_bm(:,j) + bm_new(:) / dt
693c690
<                 co2_to_bm_dgvm(:,j) = co2_to_bm_dgvm(:,j) + bm_new(:) / dt_days
---
>                 co2_to_bm(:,j) = co2_to_bm(:,j) + bm_new(:) / dt
782,804d778
< !!$             sm2(:) = 0.0
< !!$             WHERE ( d_ind(:,j) .GT. 0.0 ) 
< !!$
< !!$                ! ratio of above / total sap parts
< !!$                sm_at(:) = biomass(:,j,isapabove) / &
< !!$                     ( biomass(:,j,isapabove) + biomass(:,j,isapbelow) )
< !!$
< !!$                ! woodmass of an individual
< !!$
< !!$                woodmass(:) = &
< !!$                     ( biomass(:,j,isapabove) + biomass(:,j,isapbelow) + &
< !!$                     biomass(:,j,iheartabove) + biomass(:,j,iheartbelow) ) / ind(:,j)
< !!$
< !!$                ! crown area (m**2) depends on stem diameter (pipe model)
< !!$                dia(:) = ( woodmass(:) / ( pipe_density * pi/4. * pipe_tune2 ) ) &
< !!$                     ** ( 1. / ( 2. + pipe_tune3 ) )
< !!$
< !!$                b1(:) = pipe_k1 / ( sla(j) * pipe_density*pipe_tune2 * dia(:)**pipe_tune3 ) * &
< !!$                     ind(:,j)
< !!$                sm2(:) = lm_lastyearmax(:,j) / b1(:)
< !!$
< !!$             ENDWHERE
< 
809a784,786
>                sm_at(:) = biomass(:,j,isapabove) / &
>                     ( biomass(:,j,isapabove) + biomass(:,j,isapbelow) )
>   
830c807
<     d_ind = d_ind / dt_days
---
>     d_ind = d_ind / dt
832,834c809,811
<     CALL histwrite (hist_id_stomate, 'IND_ESTAB', itime, d_ind, kjpindex*nvm, horipft_index)
<     CALL histwrite (hist_id_stomate, 'ESTABTREE', itime, estab_rate_max_tree, kjpindex, hori_index)
<     CALL histwrite (hist_id_stomate, 'ESTABGRASS', itime, estab_rate_max_grass, kjpindex, hori_index)
---
>     CALL histwrite (hist_id_stomate, 'IND_ESTAB', itime, d_ind, npts*nvm, horipft_index)
>     CALL histwrite (hist_id_stomate, 'ESTABTREE', itime, estab_rate_max_tree, npts, hori_index)
>     CALL histwrite (hist_id_stomate, 'ESTABGRASS', itime, estab_rate_max_grass, npts, hori_index)
838c815
<   END SUBROUTINE establish_main
---
>   END SUBROUTINE establish
diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile /login/IPSL_CODE/AssimilBranche/modeles/ORCHIDEE/src_stomate/lpj_fire.f90 /login/IPSL_CODE/ORCHIDEE_1_9_5_2/modeles/ORCHIDEE/src_stomate/lpj_fire.f90
26c26
<   PUBLIC fire_main,fire_clear
---
>   PUBLIC fire,fire_clear
29c29
<   LOGICAL, SAVE                                                   :: firstcall_fire = .TRUE.
---
>   LOGICAL, SAVE                                                   :: firstcall = .TRUE.
34,36d33
< ! List of subroutines for initialization :
< !- fire_clear
< 
40c37
<     firstcall_fire = .TRUE.
---
>     firstcall = .TRUE.
43c40
<   SUBROUTINE fire_main (kjpindex, dt_days, litterpart, &
---
>   SUBROUTINE fire (npts, dt, litterpart, &
56c53
<     INTEGER(i_std), INTENT(in)                                             :: kjpindex
---
>     INTEGER(i_std), INTENT(in)                                             :: npts
58c55
<     REAL(r_std), INTENT(in)                                          :: dt_days
---
>     REAL(r_std), INTENT(in)                                          :: dt
60c57
<     REAL(r_std), DIMENSION(kjpindex,nvm,nlitt), INTENT(in)              :: litterpart
---
>     REAL(r_std), DIMENSION(npts,nvm,nlitt), INTENT(in)              :: litterpart
62c59
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                         :: litterhum_daily
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                         :: litterhum_daily
64c61
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                         :: t2m_daily
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                         :: t2m_daily
67c64
<     REAL(r_std), DIMENSION(kjpindex,nvm,nlevs), INTENT(in)         :: lignin_struc
---
>     REAL(r_std), DIMENSION(npts,nvm,nlevs), INTENT(in)         :: lignin_struc
72c69
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)            :: fireindex
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)            :: fireindex
74c71
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)            :: firelitter
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)            :: firelitter
76c73
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts), INTENT(inout)          :: biomass
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(inout)          :: biomass
78c75
<     REAl(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)                 :: ind
---
>     REAl(r_std), DIMENSION(npts,nvm), INTENT(inout)                 :: ind
80c77
<     REAL(r_std), DIMENSION(kjpindex,nlitt,nvm,nlevs), INTENT(inout):: litter
---
>     REAL(r_std), DIMENSION(npts,nlitt,nvm,nlevs), INTENT(inout):: litter
83c80
<     REAL(r_std), DIMENSION(kjpindex,nvm,nlitt), INTENT(inout)           :: dead_leaves
---
>     REAL(r_std), DIMENSION(npts,nvm,nlitt), INTENT(inout)           :: dead_leaves
85c82
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts), INTENT(inout)          :: bm_to_litter
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(inout)          :: bm_to_litter
87c84
<     REAL(r_std), DIMENSION(kjpindex), INTENT(inout)                      :: black_carbon
---
>     REAL(r_std), DIMENSION(npts), INTENT(inout)                      :: black_carbon
94c91
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(out)                        :: co2_fire
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(out)                        :: co2_fire
105c102
<     REAL(r_std), DIMENSION(kjpindex)                                     :: fire_disturb
---
>     REAL(r_std), DIMENSION(npts)                                     :: fire_disturb
107c104
<     REAL(r_std), DIMENSION(kjpindex,nvm)                                :: firedeath 
---
>     REAL(r_std), DIMENSION(npts,nvm)                                :: firedeath 
112c109
<     REAL(r_std), DIMENSION(kjpindex)                                     :: moistlimit
---
>     REAL(r_std), DIMENSION(npts)                                     :: moistlimit
114c111
<     REAL(r_std), DIMENSION(kjpindex)                                     :: litter_above
---
>     REAL(r_std), DIMENSION(npts)                                     :: litter_above
116c113
<     REAL(r_std), DIMENSION(kjpindex,nvm)                           :: fireindex_daily
---
>     REAL(r_std), DIMENSION(npts,nvm)                           :: fireindex_daily
118c115
<     REAL(r_std), DIMENSION(kjpindex, nvm)                          :: firefrac
---
>     REAL(r_std), DIMENSION(npts, nvm)                          :: firefrac
120c117
<     REAL(r_std), DIMENSION(kjpindex)                                     :: struc_residual
---
>     REAL(r_std), DIMENSION(npts)                                     :: struc_residual
122c119
<     REAL(r_std), DIMENSION(kjpindex)                                     :: residue
---
>     REAL(r_std), DIMENSION(npts)                                     :: residue
124c121
<     REAL(r_std), DIMENSION(kjpindex)                                     :: bcfrac
---
>     REAL(r_std), DIMENSION(npts)                                     :: bcfrac
126c123
<     REAL(r_std), DIMENSION(kjpindex)                                     :: x
---
>     REAL(r_std), DIMENSION(npts)                                     :: x
128c125
<     REAL(r_std), DIMENSION(kjpindex)                                     :: aff
---
>     REAL(r_std), DIMENSION(npts)                                     :: aff
140c137
<     IF ( firstcall_fire ) THEN
---
>     IF ( firstcall ) THEN
177c174
<        firstcall_fire = .FALSE.
---
>        firstcall = .FALSE.
189d185
<        RETURN
243c239
<           ! with larger dt_days, one misses dry days with very high fireindex ( strongly
---
>           ! with larger dt, one misses dry days with very high fireindex ( strongly
259c255
<        fireindex(:,j) = ((tau_fire - dt_days) * fireindex(:,j) + (dt_days) * fireindex_daily(:,j)) / tau_fire
---
>        fireindex(:,j) = ((tau_fire - dt) * fireindex(:,j) + (dt) * fireindex_daily(:,j)) / tau_fire
267c263
<             ( ( tau_fire-dt_days ) * firelitter(:,j) + dt_days * litter_above(:) ) / tau_fire
---
>             ( ( tau_fire-dt ) * firelitter(:,j) + dt * litter_above(:) ) / tau_fire
283c279
<        aff(:) = firefrac_func (kjpindex, fireindex(:,j))
---
>        aff(:) = firefrac_func (npts, fireindex(:,j))
289c285
<        ! If annual firefrac<<1, then firefrac_daily = firefrac * dt_days/one_year
---
>        ! If annual firefrac<<1, then firefrac_daily = firefrac * dt/one_year
294c290
<              firefrac(:,j) = un - ( un - aff(:) ) ** (dt_days/one_year)
---
>              firefrac(:,j) = un - ( un - aff(:) ) ** (dt/one_year)
296c292
<              firefrac(:,j) = aff(:) * dt_days/one_year
---
>              firefrac(:,j) = aff(:) * dt/one_year
310c306
<        firefrac(:,j) = MAX( 0.001_r_std * dt_days/one_year, firefrac(:,j) )
---
>        firefrac(:,j) = MAX( 0.001_r_std * dt/one_year, firefrac(:,j) )
370c366
<              co2_fire(:,j) =  co2_fire(:,j)+ biomass(:,j,k) * fire_disturb(:) * co2frac(k) / dt_days
---
>              co2_fire(:,j) =  co2_fire(:,j)+ biomass(:,j,k) * fire_disturb(:) * co2frac(k) / dt
430,431c426,427
<           ! exact formulation: 1. - (1.-fire_disturb(:)) ** (1./dt_days)
<           firedeath(:,j) = fire_disturb(:) / dt_days
---
>           ! exact formulation: 1. - (1.-fire_disturb(:)) ** (1./dt)
>           firedeath(:,j) = fire_disturb(:) / dt
453c449
<             firefrac(:,j) / dt_days
---
>             firefrac(:,j) / dt
473c469
<             ( un - struc_residual(:) )/ dt_days
---
>             ( un - struc_residual(:) )/ dt
527c523
<     firefrac(:,:) = firefrac(:,:) / dt_days
---
>     firefrac(:,:) = firefrac(:,:) / dt
530c526
<          firefrac(:,:), kjpindex*nvm, horipft_index)
---
>          firefrac(:,:), npts*nvm, horipft_index)
532c528
<          firedeath(:,:), kjpindex*nvm, horipft_index)
---
>          firedeath(:,:), npts*nvm, horipft_index)
536c532
<   END SUBROUTINE fire_main
---
>   END SUBROUTINE fire
538c534
<   FUNCTION firefrac_func (kjpindex, x) RESULT (firefrac_result)
---
>   FUNCTION firefrac_func (npts, x) RESULT (firefrac_result)
547c543
<     INTEGER(i_std), INTENT(in)                                             :: kjpindex
---
>     INTEGER(i_std), INTENT(in)                                             :: npts
549c545
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                         :: x
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                         :: x
554c550
<     REAL(r_std), DIMENSION(kjpindex)                                     :: firefrac_result
---
>     REAL(r_std), DIMENSION(npts)                                     :: firefrac_result
559c555
<     REAL(r_std), DIMENSION(kjpindex)                                     :: xm1
---
>     REAL(r_std), DIMENSION(npts)                                     :: xm1
diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile /login/IPSL_CODE/AssimilBranche/modeles/ORCHIDEE/src_stomate/lpj_gap.f90 /login/IPSL_CODE/ORCHIDEE_1_9_5_2/modeles/ORCHIDEE/src_stomate/lpj_gap.f90
26c26
<   PUBLIC gap_main,gap_clear
---
>   PUBLIC gap,gap_clear
29c29
<   LOGICAL, SAVE                                           :: firstcall_gap = .TRUE.
---
>   LOGICAL, SAVE                                           :: firstcall = .TRUE.
32,33c32
< ! List of subroutines for initialization :
< !- gap_clear
---
> 
36c35
<     firstcall_gap = .TRUE.
---
>     firstcall = .TRUE.
39c38
<   SUBROUTINE gap_main (kjpindex, dt_days, &
---
>   SUBROUTINE gap (npts, dt, &
50c49
<     INTEGER(i_std), INTENT(in)                                     :: kjpindex
---
>     INTEGER(i_std), INTENT(in)                                     :: npts
52c51
<     REAL(r_std), INTENT(in)                                  :: dt_days
---
>     REAL(r_std), INTENT(in)                                  :: dt
54c53
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)            :: npp_longterm
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)            :: npp_longterm
56c55
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts), INTENT(in)     :: turnover_longterm
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(in)     :: turnover_longterm
58c57
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)            :: lm_lastyearmax
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)            :: lm_lastyearmax
63c62
<     LOGICAL, DIMENSION(kjpindex,nvm), INTENT(in)            :: PFTpresent
---
>     LOGICAL, DIMENSION(npts,nvm), INTENT(in)            :: PFTpresent
65c64
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts), INTENT(inout)  :: biomass
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(inout)  :: biomass
67c66
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)         :: ind
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)         :: ind
69c68
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts), INTENT(inout)  :: bm_to_litter
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(inout)  :: bm_to_litter
71c70
<     REAL(r_std), DIMENSION(kjpindex,nvm),INTENT(out)             :: mortality
---
>     REAL(r_std), DIMENSION(npts,nvm),INTENT(out)             :: mortality
76c75
<     REAL(r_std), DIMENSION(kjpindex)                             :: delta_biomass
---
>     REAL(r_std), DIMENSION(npts)                             :: delta_biomass
78c77
<     REAL(r_std), DIMENSION(kjpindex)                             :: dmortality
---
>     REAL(r_std), DIMENSION(npts)                             :: dmortality
80c79
<     REAL(r_std), DIMENSION(kjpindex)                             :: vigour
---
>     REAL(r_std), DIMENSION(npts)                             :: vigour
82c81
<     REAL(r_std), DIMENSION(kjpindex)                             :: availability
---
>     REAL(r_std), DIMENSION(npts)                             :: availability
89c88,90
<     IF ( firstcall_gap ) THEN
---
>     IF ( firstcall ) THEN
> 
>        firstcall = .FALSE.
91,92d91
<        firstcall_gap = .FALSE.
<        RETURN
161c160
<                 ! Exact formulation: mor = 1. - ( 1. - availability ) ** (dt_days/one_year)
---
>                 ! Exact formulation: mor = 1. - ( 1. - availability ) ** (dt/one_year)
164,165c163,164
<                 mortality(:,j) = MAX(min_avail,availability(:))  * dt_days/one_year  
< !!$                mortality(:,j) = availability(:) * dt_days/one_year
---
>                 mortality(:,j) = MAX(min_avail,availability(:))  * dt/one_year  
> !!$                mortality(:,j) = availability(:) * dt/one_year
177c176
<                 mortality(:,j) = dt_days/(residence_time(j)*one_year)
---
>                 mortality(:,j) = dt/(residence_time(j)*one_year)
262,263c261,262
<     ! exact formulation: 1. - ( 1. - mortality ) ** (1./dt_days)
<     mortality = mortality / dt_days
---
>     ! exact formulation: 1. - ( 1. - mortality ) ** (1./dt)
>     mortality = mortality / dt
266c265
<          mortality, kjpindex*nvm, horipft_index)
---
>          mortality, npts*nvm, horipft_index)
270c269
<   END SUBROUTINE gap_main
---
>   END SUBROUTINE gap
diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile /login/IPSL_CODE/AssimilBranche/modeles/ORCHIDEE/src_stomate/lpj_kill.f90 /login/IPSL_CODE/ORCHIDEE_1_9_5_2/modeles/ORCHIDEE/src_stomate/lpj_kill.f90
24c24
<   SUBROUTINE kill (kjpindex, whichroutine, lm_lastyearmax, &
---
>   SUBROUTINE kill (npts, whichroutine, lm_lastyearmax, &
36c36
<     INTEGER(i_std), INTENT(in)                                       :: kjpindex
---
>     INTEGER(i_std), INTENT(in)                                       :: npts
40c40
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)              :: lm_lastyearmax
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)              :: lm_lastyearmax
45c45
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)           :: ind
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)           :: ind
47c47
<     LOGICAL, DIMENSION(kjpindex,nvm), INTENT(inout)              :: PFTpresent
---
>     LOGICAL, DIMENSION(npts,nvm), INTENT(inout)              :: PFTpresent
49c49
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)           :: cn_ind
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)           :: cn_ind
51c51
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts), INTENT(inout)    :: biomass
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(inout)    :: biomass
53c53
<     LOGICAL, DIMENSION(kjpindex,nvm), INTENT(inout)              :: senescence
---
>     LOGICAL, DIMENSION(npts,nvm), INTENT(inout)              :: senescence
55c55
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)           :: RIP_time
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)           :: RIP_time
57c57
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)           :: lai
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)           :: lai
59c59
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)           :: age
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)           :: age
61c61
<     REAL(r_std), DIMENSION(kjpindex,nvm,nleafages), INTENT(inout) :: leaf_age
---
>     REAL(r_std), DIMENSION(npts,nvm,nleafages), INTENT(inout) :: leaf_age
63c63
<     REAL(r_std), DIMENSION(kjpindex,nvm,nleafages), INTENT(inout) :: leaf_frac
---
>     REAL(r_std), DIMENSION(npts,nvm,nleafages), INTENT(inout) :: leaf_frac
65c65
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)           :: when_growthinit
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)           :: when_growthinit
67c67
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)           :: everywhere
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)           :: everywhere
70c70
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)           :: veget
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)           :: veget
72c72
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)           :: veget_max
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)           :: veget_max
74c74
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)           :: npp_longterm 
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)           :: npp_longterm 
76c76
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts), INTENT(inout)    :: bm_to_litter
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(inout)    :: bm_to_litter
83c83
<     LOGICAL, DIMENSION(kjpindex)                                  :: was_killed
---
>     LOGICAL, DIMENSION(npts)                                  :: was_killed
diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile /login/IPSL_CODE/AssimilBranche/modeles/ORCHIDEE/src_stomate/lpj_light.f90 /login/IPSL_CODE/ORCHIDEE_1_9_5_2/modeles/ORCHIDEE/src_stomate/lpj_light.f90
44c44
<   PUBLIC light_main, light_clear
---
>   PUBLIC light, light_clear
47c47
<   LOGICAL, SAVE                                            :: firstcall_light = .TRUE.
---
>   LOGICAL, SAVE                                            :: firstcall = .TRUE.
50,51d49
< ! List of subroutines for initialization :
< !- light_clear
54c52
<     firstcall_light=.TRUE.
---
>     firstcall=.TRUE.
57c55
<   SUBROUTINE light_main (kjpindex, dt_days, &
---
>   SUBROUTINE light (npts, dt, &
68c66
<     INTEGER(i_std), INTENT(in)                                      :: kjpindex
---
>     INTEGER(i_std), INTENT(in)                                      :: npts
70c68
<     REAL(r_std), INTENT(in)                                   :: dt_days
---
>     REAL(r_std), INTENT(in)                                   :: dt
72c70
<     LOGICAL, DIMENSION(kjpindex,nvm), INTENT(in)                :: PFTpresent
---
>     LOGICAL, DIMENSION(npts,nvm), INTENT(in)                :: PFTpresent
74c72
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)             :: cn_ind
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)             :: cn_ind
76c74
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)             :: lai
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)             :: lai
78c76
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)             :: maxfpc_lastyear
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)             :: maxfpc_lastyear
80c78
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)             :: lm_lastyearmax
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)             :: lm_lastyearmax
82c80
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)             :: veget_max
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)             :: veget_max
84c82
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)             :: fpc_max
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)             :: fpc_max
89c87
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)          :: ind
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)          :: ind
91c89
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts), INTENT(inout)   :: biomass
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(inout)   :: biomass
93c91
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)          :: veget_lastlight
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)          :: veget_lastlight
95c93
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts), INTENT(inout)   :: bm_to_litter
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(inout)   :: bm_to_litter
97c95
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)          :: mortality
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)          :: mortality
111c109
<     REAL(r_std), DIMENSION(kjpindex)                              :: sumfpc
---
>     REAL(r_std), DIMENSION(npts)                              :: sumfpc
113c111
<     REAL(r_std), DIMENSION(kjpindex)                              :: fracnat
---
>     REAL(r_std), DIMENSION(npts)                              :: fracnat
125c123
<     REAL(r_std), DIMENSION(kjpindex,nvm)                         :: fpc_nat
---
>     REAL(r_std), DIMENSION(npts,nvm)                         :: fpc_nat
133c131
<     REAL(r_std), DIMENSION(kjpindex)                              :: fpc_real
---
>     REAL(r_std), DIMENSION(npts)                              :: fpc_real
135c133
<     REAL(r_std), DIMENSION(kjpindex)                              :: lai_ind
---
>     REAL(r_std), DIMENSION(npts)                              :: lai_ind
141c139
<     REAL(r_std), DIMENSION(kjpindex,nvm)                         :: light_death
---
>     REAL(r_std), DIMENSION(npts,nvm)                         :: light_death
153c151
<     IF ( firstcall_light ) THEN
---
>     IF ( firstcall ) THEN
173,174c171,172
<        firstcall_light = .FALSE.
<        RETURN
---
>        firstcall = .FALSE.
> 
207c205
<                 !          DO i = 1, kjpindex
---
>                 !          DO i = 1, npts
246c244
< !!$                   DO i = 1, kjpindex
---
> !!$                   DO i = 1, npts
284c282
<        DO i = 1, kjpindex ! SZ why this loop and not a vector statement ?
---
>        DO i = 1, npts ! SZ why this loop and not a vector statement ?
503,504c501,502
<                    ! exact formulation: light_death(i,j) = un - survive(j) / dt_days
<                    light_death(i,j) = ( un - survive(j) ) / dt_days
---
>                    ! exact formulation: light_death(i,j) = un - survive(j) / dt
>                    light_death(i,j) = ( un - survive(j) ) / dt
530c528
<                 DO i = 1, kjpindex
---
>                 DO i = 1, npts
552c550
<                 DO i = 1, kjpindex
---
>                 DO i = 1, npts
619c617
<        light_death(:,:)=light_death(:,:)/dt_days
---
>        light_death(:,:)=light_death(:,:)/dt
628c626
<          light_death, kjpindex*nvm, horipft_index)
---
>          light_death, npts*nvm, horipft_index)
632c630
<   END SUBROUTINE light_main
---
>   END SUBROUTINE light
diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile /login/IPSL_CODE/AssimilBranche/modeles/ORCHIDEE/src_stomate/lpj_pftinout.f90 /login/IPSL_CODE/ORCHIDEE_1_9_5_2/modeles/ORCHIDEE/src_stomate/lpj_pftinout.f90
23c23
<   LOGICAL, SAVE                                             :: firstcall_pftinout = .TRUE.
---
>   LOGICAL, SAVE                                             :: firstcall = .TRUE.
26,27c26
< ! List of subroutines for initialization :
< !- pftinout_clear
---
> 
30c29
<     firstcall_pftinout = .TRUE.
---
>     firstcall = .TRUE.
33c32
<   SUBROUTINE pftinout_main (kjpindex, dt_days, adapted, regenerate, &
---
>   SUBROUTINE pftinout (npts, dt, adapted, regenerate, &
37c36
<        co2_to_bm_dgvm, &
---
>        co2_to_bm, &
47c46
<     INTEGER(i_std), INTENT(in)                                       :: kjpindex
---
>     INTEGER(i_std), INTENT(in)                                       :: npts
49c48
<     REAL(r_std), INTENT(in)                                    :: dt_days
---
>     REAL(r_std), INTENT(in)                                    :: dt
51c50
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)              :: adapted
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)              :: adapted
53c52
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)              :: regenerate
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)              :: regenerate
55c54
<     INTEGER(i_std), DIMENSION(kjpindex,8), INTENT(in)              :: neighbours
---
>     INTEGER(i_std), DIMENSION(npts,8), INTENT(in)              :: neighbours
58c57
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)           :: veget
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)           :: veget
60c59
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)           :: veget_max
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)           :: veget_max
65c64
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts), INTENT(inout)    :: biomass
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(inout)    :: biomass
67c66
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)           :: ind
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)           :: ind
69c68
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)              :: cn_ind
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)              :: cn_ind
71c70
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)           :: age
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)           :: age
73c72
<     REAL(r_std), DIMENSION(kjpindex,nvm,nleafages), INTENT(inout) :: leaf_frac
---
>     REAL(r_std), DIMENSION(npts,nvm,nleafages), INTENT(inout) :: leaf_frac
75c74
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)           :: npp_longterm
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)           :: npp_longterm
77c76
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)           :: lm_lastyearmax
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)           :: lm_lastyearmax
80c79
<     LOGICAL, DIMENSION(kjpindex,nvm), INTENT(inout)              :: senescence
---
>     LOGICAL, DIMENSION(npts,nvm), INTENT(inout)              :: senescence
82c81
<     LOGICAL, DIMENSION(kjpindex,nvm), INTENT(inout)              :: PFTpresent
---
>     LOGICAL, DIMENSION(npts,nvm), INTENT(inout)              :: PFTpresent
84c83
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)           :: everywhere
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)           :: everywhere
86c85
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)           :: when_growthinit
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)           :: when_growthinit
89c88
<     LOGICAL, DIMENSION(kjpindex,nvm), INTENT(inout)              :: need_adjacent
---
>     LOGICAL, DIMENSION(npts,nvm), INTENT(inout)              :: need_adjacent
91c90
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)           :: RIP_time
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)           :: RIP_time
94c93
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)                :: co2_to_bm_dgvm
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)                :: co2_to_bm
99c98
<     REAL(r_std), DIMENSION(kjpindex), INTENT(out)                  :: avail_tree
---
>     REAL(r_std), DIMENSION(npts), INTENT(out)                  :: avail_tree
101c100
<     REAL(r_std), DIMENSION(kjpindex), INTENT(out)                  :: avail_grass
---
>     REAL(r_std), DIMENSION(npts), INTENT(out)                  :: avail_grass
108c107
<     REAL(r_std), DIMENSION(kjpindex)                               :: avail
---
>     REAL(r_std), DIMENSION(npts)                               :: avail
112c111
<     REAL(r_std), DIMENSION(kjpindex)                               :: sumfrac_wood
---
>     REAL(r_std), DIMENSION(npts)                               :: sumfrac_wood
114c113
<     INTEGER(i_std), DIMENSION(kjpindex)                            :: n_present
---
>     INTEGER(i_std), DIMENSION(npts)                            :: n_present
116c115
<     LOGICAL, DIMENSION(kjpindex)                                  :: can_introduce
---
>     LOGICAL, DIMENSION(npts)                                  :: can_introduce
118c117
<     REAL(r_std), DIMENSION(kjpindex)                               :: fracnat
---
>     REAL(r_std), DIMENSION(npts)                               :: fracnat
128c127
<     IF ( firstcall_pftinout ) THEN
---
>     IF ( firstcall ) THEN
132,133c131,132
<        firstcall_pftinout = .FALSE.
<        RETURN
---
>        firstcall = .FALSE.
> 
177c176
<     RIP_time = RIP_time + dt_days / one_year
---
>     RIP_time = RIP_time + dt / one_year
204c203
<              DO i = 1, kjpindex
---
>              DO i = 1, npts
215c214
<                    co2_to_bm_dgvm(i,j) =  co2_to_bm_dgvm(i,j) +SUM( biomass(i,j,:) ) / dt_days
---
>                    co2_to_bm(i,j) =  co2_to_bm(i,j) +SUM( biomass(i,j,:) ) / dt
280c279
<           DO i = 1, kjpindex
---
>           DO i = 1, npts
367c366
<              ind(:,j) = ind_0 * (dt_days/one_year) * avail(:)
---
>              ind(:,j) = ind_0 * (dt/one_year) * avail(:)
391,392c390,391
<              co2_to_bm_dgvm(:,j) = &
<                   co2_to_bm_dgvm(:,j) / dt_days * &
---
>              co2_to_bm(:,j) = &
>                   co2_to_bm(:,j) / dt * &
453c452
<   END SUBROUTINE pftinout_main
---
>   END SUBROUTINE pftinout
diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile /login/IPSL_CODE/AssimilBranche/modeles/ORCHIDEE/src_stomate/stomate_alloc.f90 /login/IPSL_CODE/ORCHIDEE_1_9_5_2/modeles/ORCHIDEE/src_stomate/stomate_alloc.f90
30c30
<   LOGICAL, SAVE                                             :: firstcall_alloc = .TRUE.
---
>   LOGICAL, SAVE                                             :: firstcall = .TRUE.
32,34d31
< ! List of subroutines for initialization :
< !- alloc_clear
< 
36c33
<     firstcall_alloc = .TRUE.
---
>     firstcall = .TRUE.
39c36
<   SUBROUTINE alloc_main (kjpindex, dt_days, &
---
>   SUBROUTINE alloc (npts, dt, &
51c48
<     INTEGER(i_std), INTENT(in)                                       :: kjpindex
---
>     INTEGER(i_std), INTENT(in)                                       :: npts
53c50
<     REAL(r_std), INTENT(in)                                    :: dt_days
---
>     REAL(r_std), INTENT(in)                                    :: dt
55c52
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)              :: lai
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)              :: lai
57c54
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)              :: veget_max
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)              :: veget_max
59c56
<     LOGICAL, DIMENSION(kjpindex,nvm), INTENT(in)                 :: senescence
---
>     LOGICAL, DIMENSION(npts,nvm), INTENT(in)                 :: senescence
61c58
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)              :: when_growthinit
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)              :: when_growthinit
63c60
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)              :: moiavail_week
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)              :: moiavail_week
65c62
<     REAL(r_std), DIMENSION(kjpindex,nbdl), INTENT(in)              :: tsoil_month
---
>     REAL(r_std), DIMENSION(npts,nbdl), INTENT(in)              :: tsoil_month
67c64
<     REAL(r_std), DIMENSION(kjpindex,nbdl), INTENT(in)              :: soilhum_month
---
>     REAL(r_std), DIMENSION(npts,nbdl), INTENT(in)              :: soilhum_month
69c66
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)              :: age
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)              :: age
74c71
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts), INTENT(inout)    :: biomass
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(inout)    :: biomass
76c73
<     REAL(r_std), DIMENSION(kjpindex,nvm,nleafages), INTENT(inout) :: leaf_age
---
>     REAL(r_std), DIMENSION(npts,nvm,nleafages), INTENT(inout) :: leaf_age
78c75
<     REAL(r_std), DIMENSION(kjpindex,nvm,nleafages), INTENT(inout) :: leaf_frac
---
>     REAL(r_std), DIMENSION(npts,nvm,nleafages), INTENT(inout) :: leaf_frac
85c82
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)             :: rprof
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)             :: rprof
87c84
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts), INTENT(out)      :: f_alloc
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(out)      :: f_alloc
116c113
<     REAL(r_std), DIMENSION(kjpindex)                               :: limit_L
---
>     REAL(r_std), DIMENSION(npts)                               :: limit_L
118c115
<     REAL(r_std), DIMENSION(kjpindex)                               :: limit_N
---
>     REAL(r_std), DIMENSION(npts)                               :: limit_N
120c117
<     REAL(r_std), DIMENSION(kjpindex)                               :: limit_N_temp
---
>     REAL(r_std), DIMENSION(npts)                               :: limit_N_temp
122c119
<     REAL(r_std), DIMENSION(kjpindex)                               :: limit_N_hum
---
>     REAL(r_std), DIMENSION(npts)                               :: limit_N_hum
124c121
<     REAL(r_std), DIMENSION(kjpindex)                               :: limit_W
---
>     REAL(r_std), DIMENSION(npts)                               :: limit_W
126c123
<     REAL(r_std), DIMENSION(kjpindex)                               :: limit_WorN
---
>     REAL(r_std), DIMENSION(npts)                               :: limit_WorN
128c125
<     REAL(r_std), DIMENSION(kjpindex)                               :: limit
---
>     REAL(r_std), DIMENSION(npts)                               :: limit
132c129
<     REAL(r_std), DIMENSION(kjpindex)                               :: t_nitrogen
---
>     REAL(r_std), DIMENSION(npts)                               :: t_nitrogen
134c131
<     REAL(r_std), DIMENSION(kjpindex)                               :: h_nitrogen
---
>     REAL(r_std), DIMENSION(npts)                               :: h_nitrogen
136c133
<     REAL(r_std), DIMENSION(kjpindex)                               :: rpc
---
>     REAL(r_std), DIMENSION(npts)                               :: rpc
138c135
<     REAL(r_std), DIMENSION(kjpindex)                               :: LtoLSR
---
>     REAL(r_std), DIMENSION(npts)                               :: LtoLSR
140c137
<     REAL(r_std), DIMENSION(kjpindex)                               :: StoLSR
---
>     REAL(r_std), DIMENSION(npts)                               :: StoLSR
142c139
<     REAL(r_std), DIMENSION(kjpindex)                               :: RtoLSR
---
>     REAL(r_std), DIMENSION(npts)                               :: RtoLSR
144c141
<     REAL(r_std), DIMENSION(kjpindex)                               :: carb_rescale
---
>     REAL(r_std), DIMENSION(npts)                               :: carb_rescale
146c143
<     REAL(r_std), DIMENSION(kjpindex)                               :: use_reserve
---
>     REAL(r_std), DIMENSION(npts)                               :: use_reserve
148c145
<     REAL(r_std), DIMENSION(kjpindex)                               :: transloc_leaf
---
>     REAL(r_std), DIMENSION(npts)                               :: transloc_leaf
150c147
<     REAL(r_std), DIMENSION(kjpindex)                               :: leaf_mass_young
---
>     REAL(r_std), DIMENSION(npts)                               :: leaf_mass_young
152c149
<     REAL(r_std), DIMENSION(kjpindex,nvm)                          :: lm_old
---
>     REAL(r_std), DIMENSION(npts,nvm)                          :: lm_old
156c153
<     REAL(r_std), DIMENSION(kjpindex,nvm)                          :: lai_around
---
>     REAL(r_std), DIMENSION(npts,nvm)                          :: lai_around
158c155
<     REAL(r_std), DIMENSION(kjpindex,nvm)                          :: veget_max_nat 
---
>     REAL(r_std), DIMENSION(npts,nvm)                          :: veget_max_nat 
160c157
<     REAL(r_std), DIMENSION(kjpindex)                               :: natveg_tot
---
>     REAL(r_std), DIMENSION(npts)                               :: natveg_tot
162c159
<     REAL(r_std), DIMENSION(kjpindex)                               :: lai_nat
---
>     REAL(r_std), DIMENSION(npts)                               :: lai_nat
164c161
<     REAL(r_std), DIMENSION(kjpindex)                               :: zdiff_min
---
>     REAL(r_std), DIMENSION(npts)                               :: zdiff_min
166c163,165
<     REAL(r_std), DIMENSION(kjpindex)                               :: alloc_sap_above
---
>     REAL(r_std), DIMENSION(npts)                               :: alloc_sap_above
>     ! soil levels (m)
>     REAL(r_std), SAVE, DIMENSION(0:nbdl)                       :: z_soil
182c181,186
<     IF ( firstcall_alloc ) THEN
---
>     IF ( firstcall ) THEN
> 
>        ! 1.1.1 soil levels
> 
>        z_soil(0) = zero
>        z_soil(1:nbdl) = diaglev(1:nbdl)
184c188
<        ! 1.1.1 info about flags and parameters.
---
>        ! 1.1.2 info about flags and parameters.
213,214c217
<        firstcall_alloc = .FALSE.
<        RETURN
---
>        firstcall = .FALSE.
342c345
<                2._r_std * dt_days/tau_leafinit * lai_happy(j)/ sla(j) )
---
>                2._r_std * dt/tau_leafinit * lai_happy(j)/ sla(j) )
414,415c417,418
<        ! we could have alloc_sap_above(kjpindex,nvm) but we have only
<        ! alloc_sap_above(kjpindex) as we make a loop over j=2,nvm
---
>        ! we could have alloc_sap_above(npts,nvm) but we have only
>        ! alloc_sap_above(npts) as we make a loop over j=2,nvm
511c514
<        DO i = 1, kjpindex
---
>        DO i = 1, npts
567c570
<   END SUBROUTINE alloc_main
---
>   END SUBROUTINE alloc
diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile /login/IPSL_CODE/AssimilBranche/modeles/ORCHIDEE/src_stomate/stomate_assimtemp.f90 /login/IPSL_CODE/ORCHIDEE_1_9_5_2/modeles/ORCHIDEE/src_stomate/stomate_assimtemp.f90
23c23
<   SUBROUTINE assim_temp (kjpindex, tlong_ref, t2m_month, t_photo_min, t_photo_opt, t_photo_max)
---
>   SUBROUTINE assim_temp (npts, tlong_ref, t2m_month, t_photo_min, t_photo_opt, t_photo_max)
32c32
<     INTEGER(i_std), INTENT(in)                                        :: kjpindex
---
>     INTEGER(i_std), INTENT(in)                                        :: npts
34c34
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                    :: tlong_ref
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                    :: tlong_ref
36c36
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                    :: t2m_month
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                    :: t2m_month
40c40
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(out)              :: t_photo_min
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(out)              :: t_photo_min
42c42
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(out)              :: t_photo_opt
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(out)              :: t_photo_opt
44c44
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(out)              :: t_photo_max
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(out)              :: t_photo_max
48c48
<     REAL(r_std), DIMENSION(kjpindex)                                :: tl
---
>     REAL(r_std), DIMENSION(npts)                                :: tl
diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile /login/IPSL_CODE/AssimilBranche/modeles/ORCHIDEE/src_stomate/stomate_constants.f90 /login/IPSL_CODE/ORCHIDEE_1_9_5_2/modeles/ORCHIDEE/src_stomate/stomate_constants.f90
491a492
>   CALL getin_p("residence_time", residence_time)
772a774
>   CALL getin_p("tphoto_min_c_tab", tphoto_min_c_tab)
diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile /login/IPSL_CODE/AssimilBranche/modeles/ORCHIDEE/src_stomate/stomate_data.f90 /login/IPSL_CODE/ORCHIDEE_1_9_5_2/modeles/ORCHIDEE/src_stomate/stomate_data.f90
26c26
<   SUBROUTINE data (kjpindex, lalo)
---
>   SUBROUTINE data (npts, lalo)
35c35
<     INTEGER(i_std), INTENT(in)                               :: kjpindex
---
>     INTEGER(i_std), INTENT(in)                               :: npts
37c37
<     REAL(r_std),DIMENSION (kjpindex,2), INTENT (in)        :: lalo
---
>     REAL(r_std),DIMENSION (npts,2), INTENT (in)        :: lalo
diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile /login/IPSL_CODE/AssimilBranche/modeles/ORCHIDEE/src_stomate/stomate.f90 /login/IPSL_CODE/ORCHIDEE_1_9_5_2/modeles/ORCHIDEE/src_stomate/stomate.f90
35d34
< 
39,46d37
<   ! soil levels (m)
<   REAL(r_std),DIMENSION(0:nbdl)                   :: z_soil
<   ! root depth. This will, one day, be a prognostic variable.
<   ! It will be calculated by
<   ! STOMATE (save in restart file & give to hydrology module!),
<   ! probably somewhere
<   ! in the allocation routine. For the moment, it is prescribed.
<   REAL(r_std),ALLOCATABLE,SAVE,DIMENSION(:,:)            :: rprof
56c47
<   REAL(r_std),ALLOCATABLE,SAVE,DIMENSION(:,:)    :: moiavail_daily
---
>   REAL(r_std),ALLOCATABLE,SAVE,DIMENSION(:,:)    :: humrel_daily
84c75
<   REAL(r_std),ALLOCATABLE,SAVE,DIMENSION(:,:)    :: moiavail_month
---
>   REAL(r_std),ALLOCATABLE,SAVE,DIMENSION(:,:)    :: humrel_month
86c77
<   REAL(r_std),ALLOCATABLE,SAVE,DIMENSION(:,:)    :: moiavail_week
---
>   REAL(r_std),ALLOCATABLE,SAVE,DIMENSION(:,:)    :: humrel_week
108c99
<   REAL(r_std),ALLOCATABLE,SAVE,DIMENSION(:,:)    :: maxmoiavail_lastyear
---
>   REAL(r_std),ALLOCATABLE,SAVE,DIMENSION(:,:)    :: maxhumrel_lastyear
110c101
<   REAL(r_std),ALLOCATABLE,SAVE,DIMENSION(:,:)    :: maxmoiavail_thisyear
---
>   REAL(r_std),ALLOCATABLE,SAVE,DIMENSION(:,:)    :: maxhumrel_thisyear
112c103
<   REAL(r_std),ALLOCATABLE,SAVE,DIMENSION(:,:)    :: minmoiavail_lastyear
---
>   REAL(r_std),ALLOCATABLE,SAVE,DIMENSION(:,:)    :: minhumrel_lastyear
114c105
<   REAL(r_std),ALLOCATABLE,SAVE,DIMENSION(:,:)    :: minmoiavail_thisyear
---
>   REAL(r_std),ALLOCATABLE,SAVE,DIMENSION(:,:)    :: minhumrel_thisyear
268c259
<   REAL(r_std),ALLOCATABLE,DIMENSION(:,:,:)   :: moiavail_daily_fm
---
>   REAL(r_std),ALLOCATABLE,DIMENSION(:,:,:)   :: humrel_daily_fm
280c271
<   PUBLIC clay_fm, moiavail_daily_fm, litterhum_daily_fm, t2m_daily_fm, t2m_min_daily_fm, tsurf_daily_fm, tsoil_daily_fm, &
---
>   PUBLIC clay_fm, humrel_daily_fm, litterhum_daily_fm, t2m_daily_fm, t2m_min_daily_fm, tsurf_daily_fm, tsoil_daily_fm, &
284c275
<   REAL(r_std),ALLOCATABLE,DIMENSION(:,:,:)   :: moiavail_daily_fm_g
---
>   REAL(r_std),ALLOCATABLE,DIMENSION(:,:,:)   :: humrel_daily_fm_g
333,338d323
< ! List of subroutines for initialization :
< !- stomate_init
< !- stomate_clear
< !- stomate_var_init
< !- init_forcing
< !- forcing_zero
345,346c330,331
<        &  index, lalo, neighbours, resolution, contfrac, totfrac_nobio, clayfraction, &
<        &  t2mdiag, t2mdiag_min, temp_sol, stempdiag, &
---
>        &  index, lalo, neighbours, resolution, contfrac, totfrac_nobio, clay, &
>        &  t2m, t2m_min, temp_sol, stempdiag, &
406c391
<     REAL(r_std),DIMENSION(kjpindex),INTENT(in)       :: clayfraction
---
>     REAL(r_std),DIMENSION(kjpindex),INTENT(in)       :: clay
410c395
<     REAL(r_std),DIMENSION(kjpindex),INTENT(in)       :: t2mdiag
---
>     REAL(r_std),DIMENSION(kjpindex),INTENT(in)       :: t2m
412c397
<     REAL(r_std),DIMENSION(kjpindex),INTENT(in)       :: t2mdiag_min
---
>     REAL(r_std),DIMENSION(kjpindex),INTENT(in)       :: t2m_min
480a466,467
>     ! soil level used for LAI
>     INTEGER(i_std),SAVE                          :: lcanop
561c548,555
<     !
---
>     ! soil levels (m)
>     REAL(r_std),DIMENSION(0:nbdl)                   :: z_soil
>     ! root depth. This will, one day, be a prognostic variable.
>     ! It will be calculated by
>     ! STOMATE (save in restart file & give to hydrology module!),
>     ! probably somewhere
>     ! in the allocation routine. For the moment, it is prescribed.
>     REAL(r_std),DIMENSION(kjpindex,nvm)            :: rprof
579d572
< 
581,589d573
<     !-
<     ! 1 do initialisation
<     !-
<     IF (l_first_stomate) THEN
< 
<        IF (long_print) THEN
<           WRITE (numout,*) ' l_first_stomate : call stomate_init'
<        ENDIF
< 
593,594d576
<       ! 1.0.0 soil levels
< 
600c582,589
< 
---
>     !-
>     ! 1 do initialisation
>     !-
>     resp_growth=zero
>     IF (l_first_stomate) THEN
>        IF (long_print) THEN
>           WRITE (numout,*) ' l_first_stomate : call stomate_init'
>        ENDIF
627c616
<             &         moiavail_daily, litterhum_daily, &
---
>             &         humrel_daily, litterhum_daily, &
631c620
<             &         moiavail_month, moiavail_week, &
---
>             &         humrel_month, humrel_week, &
634,635c623,624
<             &         maxmoiavail_lastyear, maxmoiavail_thisyear, &
<             &         minmoiavail_lastyear, minmoiavail_thisyear, &
---
>             &         maxhumrel_lastyear, maxhumrel_thisyear, &
>             &         minhumrel_lastyear, minhumrel_thisyear, &
738,739c727,728
<                   &      SIZE(clayfraction)*KIND(clayfraction) &
<                   &           +SIZE(moiavail_daily)*KIND(moiavail_daily) &
---
>                   &      SIZE(clay)*KIND(clay) &
>                   &           +SIZE(humrel_daily)*KIND(humrel_daily) &
978,1059d966
< 
<        resp_growth=zero
<        !
<        CALL maint_respiration_main &
<             &  (kjpindex,dtradia,lai,t2mdiag,tlong_ref,stempdiag,height,veget_cov_max, &
<             &   rprof,biomass,resp_maint_part_radia)
<        
<        CALL littercalc_main (kjpindex, dtradia/one_day, &
<             turnover_littercalc, bm_to_littercalc, &
<             veget_cov_max, temp_sol, stempdiag, shumdiag, litterhumdiag, &
<             litterpart, litter, dead_leaves, lignin_struc, &
<             deadleaf_cover, resp_hetero_litter, &
<             soilcarbon_input_inst, control_temp_inst, control_moist_inst)
<        resp_hetero_litter=resp_hetero_litter*dtradia/one_day
< 
<        CALL soilcarbon_main (kjpindex, dtradia/one_day, clayfraction, &
<             soilcarbon_input_inst, control_temp_inst, control_moist_inst, &
<             carbon, resp_hetero_soil)
<        resp_hetero_soil=resp_hetero_soil*dtradia/one_day
<        resp_hetero_radia = resp_hetero_litter+resp_hetero_soil
<        resp_hetero_d = resp_hetero_d + resp_hetero_radia
< 
<        CALL season_main &
<             &          (kjpindex, dt_days, EndOfYear, &
<             &           veget_cov, veget_cov_max, &
<             &           moiavail_daily, t2m_daily, tsoil_daily, soilhum_daily, &
<             &           precip_daily, npp_daily, biomass, &
<             &           turnover_daily, gpp_daily, when_growthinit, &
<             &           maxmoiavail_lastyear, maxmoiavail_thisyear, &
<             &           minmoiavail_lastyear, minmoiavail_thisyear, &
<             &           maxgppweek_lastyear, maxgppweek_thisyear, &
<             &           gdd0_lastyear, gdd0_thisyear, &
<             &           precip_lastyear, precip_thisyear, &
<             &           lm_lastyearmax, lm_thisyearmax, &
<             &           maxfpc_lastyear, maxfpc_thisyear, &
<             &           moiavail_month, moiavail_week, t2m_longterm, &
<             &           tlong_ref, t2m_month, t2m_week, tsoil_month, soilhum_month, &
<             &           npp_longterm, turnover_longterm, gpp_week, &
<             &           gdd_m5_dormance, gdd_midwinter, ncd_dormance, ngd_minus5, &
<             &           time_lowgpp, time_hum_min, hum_min_dormance, herbivores)
< 
< 
<        IF (control%ok_stomate) THEN
<           
<           ! 6.3.1  call stomate
<           
<           CALL StomateLpj_main &
<                &            (kjpindex, dt_days, EndOfYear, EndOfMonth, &
<                &             neighbours, resolution, &
<                &             clayfraction, herbivores, &
<                &             tsurf_daily, tsoil_daily, t2m_daily, t2m_min_daily, &
<                &             litterhum_daily, soilhum_daily, &
<                &             maxmoiavail_lastyear, minmoiavail_lastyear, &
<                &             gdd0_lastyear, precip_lastyear, &
<                &             moiavail_month, moiavail_week, tlong_ref, t2m_month, t2m_week, &
<                &             tsoil_month, soilhum_month, &
<                &             gdd_m5_dormance, gdd_midwinter, ncd_dormance, ngd_minus5, &
<                &             turnover_longterm, gpp_daily, time_lowgpp, &
<                &             time_hum_min, maxfpc_lastyear, resp_maint_part,&
<                &             PFTpresent, age, fireindex, firelitter, &
<                &             leaf_age, leaf_frac, biomass, ind, adapted, regenerate, &
<                &             senescence, when_growthinit, litterpart, litter, &
<                &             dead_leaves, carbon, black_carbon, lignin_struc, &
<                &             veget_cov_max, veget_cov, npp_longterm, lm_lastyearmax, &
<                &             veget_lastlight, everywhere, need_adjacent, RIP_time, &
<                &             lai, rprof,npp_daily, turnover_daily, turnover_time,&
<                &             control_moist_inst, control_temp_inst, soilcarbon_input_inst, &
<                &             co2_to_bm_dgvm, co2_fire, &
<                &             resp_hetero_d, resp_maint_d, resp_growth_d, &
<                &             height, deadleaf_cover, vcmax, vjmax, &
<                &             t_photo_min, t_photo_opt, t_photo_max,bm_to_litter,&
<                &             prod10, prod100, flux10, flux100, veget_cov_max_new,&
<                &             convflux, cflux_prod10, cflux_prod100, harvest_above, carb_mass_total, lcchange,&
<                &             fpc_max)
< 
<           resp_maint(:,:) = resp_maint_radia(:,:)*veget_cov_max(:,:)
<           resp_maint(:,ibare_sechiba) = zero
<           resp_growth(:,:)= resp_growth_d(:,:)*veget_cov_max(:,:)*dtradia/one_day
<           !
<           resp_hetero(:,:) = resp_hetero_radia(:,:)*veget_cov_max(:,:)
<           
<        ENDIF
1069,1071d975
< 
<     ! store time step in common value
<     itime = kjit
1087c991
<             &          moiavail_daily, litterhum_daily, &
---
>             &          humrel_daily, litterhum_daily, &
1091c995
<             &          moiavail_month, moiavail_week, &
---
>             &          humrel_month, humrel_week, &
1094,1095c998,999
<             &          maxmoiavail_lastyear, maxmoiavail_thisyear, &
<             &          minmoiavail_lastyear, minmoiavail_thisyear, &
---
>             &          maxhumrel_lastyear, maxhumrel_thisyear, &
>             &          minhumrel_lastyear, minhumrel_thisyear, &
1154c1058
<           CALL gather(clayfraction,clay_g)
---
>           CALL gather(clay,clay_g)
1291c1195
<          &                   do_slow, humrel, moiavail_daily)
---
>          &                   do_slow, humrel, humrel_daily)
1295c1199
<          &                   do_slow, t2mdiag, t2m_daily)
---
>          &                   do_slow, t2m, t2m_daily)
1310c1214
<     t2m_min_daily(:) = MIN( t2mdiag_min(:), t2m_min_daily(:) )
---
>     t2m_min_daily(:) = MIN( t2m_min(:), t2m_min_daily(:) )
1318,1319c1222,1223
<     CALL maint_respiration_main &
<          &  (kjpindex,dtradia,lai,t2mdiag,tlong_ref,stempdiag,height,veget_cov_max, &
---
>     CALL maint_respiration &
>          &  (kjpindex,dtradia,lai,t2m,tlong_ref,stempdiag,height,veget_cov_max, &
1340c1244
<     CALL littercalc_main (kjpindex, dtradia/one_day, &
---
>     CALL littercalc (kjpindex, dtradia/one_day, &
1354c1258
<     CALL soilcarbon_main (kjpindex, dtradia/one_day, clayfraction, &
---
>     CALL soilcarbon (kjpindex, dtradia/one_day, clay, &
1389c1293
<        CALL season_main &
---
>        CALL season &
1392c1296
<             &           moiavail_daily, t2m_daily, tsoil_daily, soilhum_daily, &
---
>             &           humrel_daily, t2m_daily, tsoil_daily, soilhum_daily, &
1395,1396c1299,1300
<             &           maxmoiavail_lastyear, maxmoiavail_thisyear, &
<             &           minmoiavail_lastyear, minmoiavail_thisyear, &
---
>             &           maxhumrel_lastyear, maxhumrel_thisyear, &
>             &           minhumrel_lastyear, minhumrel_thisyear, &
1402c1306
<             &           moiavail_month, moiavail_week, t2m_longterm, &
---
>             &           humrel_month, humrel_week, t2m_longterm, &
1414c1318
<           CALL StomateLpj_main &
---
>           CALL StomateLpj &
1417c1321
<                &             clayfraction, herbivores, &
---
>                &             clay, herbivores, &
1420c1324
<                &             maxmoiavail_lastyear, minmoiavail_lastyear, &
---
>                &             maxhumrel_lastyear, minhumrel_lastyear, &
1422c1326
<                &             moiavail_month, moiavail_week, tlong_ref, t2m_month, t2m_week, &
---
>                &             humrel_month, humrel_week, tlong_ref, t2m_month, t2m_week, &
1552c1456
<           moiavail_daily(:,ibare_sechiba) = humrel(:,ibare_sechiba)   
---
>           humrel_daily(:,ibare_sechiba) = humrel(:,ibare_sechiba)   
1563,1565c1467,1469
<              clay_fm(:,iisf) = (xn*clay_fm(:,iisf)+clayfraction(:))/(xn+1.)
<              moiavail_daily_fm(:,:,iisf) = &
<                   &                (xn*moiavail_daily_fm(:,:,iisf) + moiavail_daily(:,:))/(xn+1.)
---
>              clay_fm(:,iisf) = (xn*clay_fm(:,iisf)+clay(:))/(xn+1.)
>              humrel_daily_fm(:,:,iisf) = &
>                   &                (xn*humrel_daily_fm(:,:,iisf) + humrel_daily(:,:))/(xn+1.)
1589,1590c1493,1494
<              clay_fm(:,iisf) = clayfraction(:)
<              moiavail_daily_fm(:,:,iisf) = moiavail_daily(:,:)
---
>              clay_fm(:,iisf) = clay(:)
>              humrel_daily_fm(:,:,iisf) = humrel_daily(:,:)
1727c1631
<        moiavail_daily(:,:) = zero
---
>        humrel_daily(:,:) = zero
1768,1774d1671
<     ELSE
<        co2_flux(:,:) = zero
<        fco2_lu(:) = zero
<     
<        resp_maint(:,:)  = zero
<        resp_hetero(:,:) = zero
<        resp_growth(:,:) = zero
1889,1890d1785
<     ALLOCATE(rprof(kjpindex,nvm),stat=ier)
<     l_error = .FALSE.
1901c1796
<     ALLOCATE(moiavail_daily(kjpindex,nvm),stat=ier)
---
>     ALLOCATE(humrel_daily(kjpindex,nvm),stat=ier)
1925c1820
<     ALLOCATE(moiavail_month(kjpindex,nvm),stat=ier)
---
>     ALLOCATE(humrel_month(kjpindex,nvm),stat=ier)
1927c1822
<     ALLOCATE(moiavail_week(kjpindex,nvm),stat=ier)
---
>     ALLOCATE(humrel_week(kjpindex,nvm),stat=ier)
1945c1840
<     ALLOCATE(maxmoiavail_lastyear(kjpindex,nvm),stat=ier)
---
>     ALLOCATE(maxhumrel_lastyear(kjpindex,nvm),stat=ier)
1947c1842
<     ALLOCATE(maxmoiavail_thisyear(kjpindex,nvm),stat=ier)
---
>     ALLOCATE(maxhumrel_thisyear(kjpindex,nvm),stat=ier)
1949c1844
<     ALLOCATE(minmoiavail_lastyear(kjpindex,nvm),stat=ier)
---
>     ALLOCATE(minhumrel_lastyear(kjpindex,nvm),stat=ier)
1951c1846
<     ALLOCATE(minmoiavail_thisyear(kjpindex,nvm),stat=ier)
---
>     ALLOCATE(minhumrel_thisyear(kjpindex,nvm),stat=ier)
2189c2084
<     !Config  Desc = Harvest model for agricol PFTs.
---
>     !Config  Desc = Harvert model for agricol PFTs.
2229d2123
<     IF (ALLOCATED(rprof)) DEALLOCATE(rprof)
2235c2129
<     IF (ALLOCATED(moiavail_daily)) DEALLOCATE(moiavail_daily)
---
>     IF (ALLOCATED(humrel_daily)) DEALLOCATE(humrel_daily)
2247,2248c2141,2142
<     IF (ALLOCATED(moiavail_month)) DEALLOCATE(moiavail_month)
<     IF (ALLOCATED(moiavail_week)) DEALLOCATE(moiavail_week)
---
>     IF (ALLOCATED(humrel_month)) DEALLOCATE(humrel_month)
>     IF (ALLOCATED(humrel_week)) DEALLOCATE(humrel_week)
2257,2260c2151,2154
<     IF (ALLOCATED(maxmoiavail_lastyear)) DEALLOCATE(maxmoiavail_lastyear)
<     IF (ALLOCATED(maxmoiavail_thisyear)) DEALLOCATE(maxmoiavail_thisyear)
<     IF (ALLOCATED(minmoiavail_lastyear)) DEALLOCATE(minmoiavail_lastyear)
<     IF (ALLOCATED(minmoiavail_thisyear)) DEALLOCATE(minmoiavail_thisyear)
---
>     IF (ALLOCATED(maxhumrel_lastyear)) DEALLOCATE(maxhumrel_lastyear)
>     IF (ALLOCATED(maxhumrel_thisyear)) DEALLOCATE(maxhumrel_thisyear)
>     IF (ALLOCATED(minhumrel_lastyear)) DEALLOCATE(minhumrel_lastyear)
>     IF (ALLOCATED(minhumrel_thisyear)) DEALLOCATE(minhumrel_thisyear)
2318c2212
<     IF (ALLOCATED(moiavail_daily_fm)) DEALLOCATE(moiavail_daily_fm)
---
>     IF (ALLOCATED(humrel_daily_fm)) DEALLOCATE(humrel_daily_fm)
2333c2227
<        IF (ALLOCATED(moiavail_daily_fm_g)) DEALLOCATE(moiavail_daily_fm_g)
---
>        IF (ALLOCATED(humrel_daily_fm_g)) DEALLOCATE(humrel_daily_fm_g)
2366d2259
<     IF ( ALLOCATED (carb_mass_total)) DEALLOCATE (carb_mass_total)
2381,2382d2273
<     CALL maint_respiration_clear
<     CALL StomateLpj_clear
2517c2408
<        &  (kjpindex, n_dim2, dt_tot, dt_days, ldmean, field_in, field_out)
---
>        &  (npts, n_dim2, dt_tot, dt, ldmean, field_in, field_out)
2525c2416
<     INTEGER(i_std),INTENT(in)                       :: kjpindex
---
>     INTEGER(i_std),INTENT(in)                       :: npts
2531c2422
<     REAL(r_std),INTENT(in)                           :: dt_days
---
>     REAL(r_std),INTENT(in)                           :: dt
2535c2426
<     REAL(r_std),DIMENSION(kjpindex,n_dim2),INTENT(in)    :: field_in
---
>     REAL(r_std),DIMENSION(npts,n_dim2),INTENT(in)    :: field_in
2540c2431
<     REAL(r_std),DIMENSION(kjpindex,n_dim2),INTENT(inout) :: field_out
---
>     REAL(r_std),DIMENSION(npts,n_dim2),INTENT(inout) :: field_out
2545c2436
<     field_out(:,:) = field_out(:,:)+field_in(:,:)*dt_days
---
>     field_out(:,:) = field_out(:,:)+field_in(:,:)*dt
2568c2459
<     ALLOCATE(moiavail_daily_fm(kjpindex,nvm,nsfm),stat=ier)
---
>     ALLOCATE(humrel_daily_fm(kjpindex,nvm,nsfm),stat=ier)
2606c2497
<        ALLOCATE(moiavail_daily_fm_g(nbp_glo,nvm,nsfm),stat=ier)
---
>        ALLOCATE(humrel_daily_fm_g(nbp_glo,nvm,nsfm),stat=ier)
2636c2527
<        ALLOCATE(moiavail_daily_fm_g(0,nvm,nsfm),stat=ier)
---
>        ALLOCATE(humrel_daily_fm_g(0,nvm,nsfm),stat=ier)
2664c2555
<     moiavail_daily_fm(:,:,:) = zero
---
>     humrel_daily_fm(:,:,:) = zero
2715c2606
<     CALL gather(moiavail_daily_fm,moiavail_daily_fm_g)
---
>     CALL gather(humrel_daily_fm,humrel_daily_fm_g)
2740c2631
<              count_force(1:ndim) = SHAPE(moiavail_daily_fm_g)
---
>              count_force(1:ndim) = SHAPE(humrel_daily_fm_g)
2744c2635
<                   &            moiavail_daily_fm_g(:,:,ifirst(iblocks):ilast(iblocks)), &
---
>                   &            humrel_daily_fm_g(:,:,ifirst(iblocks):ilast(iblocks)), &
2867c2758
<           moiavail_daily_fm(:,:,iisf) = zero
---
>           humrel_daily_fm(:,:,iisf) = zero
2925c2816
<              count_force(1:ndim) = SHAPE(moiavail_daily_fm_g)
---
>              count_force(1:ndim) = SHAPE(humrel_daily_fm_g)
2930c2821
<                   &            moiavail_daily_fm_g(:,:,ifirst(iblocks):ilast(iblocks)), &
---
>                   &            humrel_daily_fm_g(:,:,ifirst(iblocks):ilast(iblocks)), &
3063c2954
<     CALL scatter(moiavail_daily_fm_g,moiavail_daily_fm)
---
>     CALL scatter(humrel_daily_fm_g,humrel_daily_fm)
3080c2971
<   SUBROUTINE setlai(kjpindex,lai)
---
>   SUBROUTINE setlai(npts,lai)
3091c2982
<     INTEGER(i_std),INTENT(in)                    :: kjpindex
---
>     INTEGER(i_std),INTENT(in)                    :: npts
3093c2984
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out)  :: lai
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out)  :: lai
diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile /login/IPSL_CODE/AssimilBranche/modeles/ORCHIDEE/src_stomate/stomate_io.f90 /login/IPSL_CODE/ORCHIDEE_1_9_5_2/modeles/ORCHIDEE/src_stomate/stomate_io.f90
23c23
<   LOGICAL,SAVE :: firstcall_io = .TRUE.
---
>   LOGICAL,SAVE :: firstcall = .TRUE.
34c34
<        & (kjpindex, index, lalo, resolution, day_counter, dt_days, date, &
---
>        & (npts, index, lalo, resolution, day_counter, dt_days, date, &
67c67
<     INTEGER(i_std),INTENT(in) :: kjpindex
---
>     INTEGER(i_std),INTENT(in) :: npts
69c69
<     INTEGER(i_std),DIMENSION(kjpindex),INTENT(in) :: index
---
>     INTEGER(i_std),DIMENSION(npts),INTENT(in) :: index
71c71
<     REAL(r_std),DIMENSION(kjpindex,2),INTENT(in) :: lalo
---
>     REAL(r_std),DIMENSION(npts,2),INTENT(in) :: lalo
73c73
<     REAL(r_std),DIMENSION(kjpindex,2),INTENT(in) :: resolution
---
>     REAL(r_std),DIMENSION(npts,2),INTENT(in) :: resolution
84c84
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: ind
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out) :: ind
86c86
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: adapted
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out) :: adapted
88c88
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: regenerate
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out) :: regenerate
90c90
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: moiavail_daily
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out) :: moiavail_daily
92c92
<     REAL(r_std),DIMENSION(kjpindex),INTENT(out)      :: litterhum_daily
---
>     REAL(r_std),DIMENSION(npts),INTENT(out)      :: litterhum_daily
94c94
<     REAL(r_std),DIMENSION(kjpindex),INTENT(out)      :: t2m_daily
---
>     REAL(r_std),DIMENSION(npts),INTENT(out)      :: t2m_daily
96c96
<     REAL(r_std),DIMENSION(kjpindex),INTENT(out)      :: t2m_min_daily
---
>     REAL(r_std),DIMENSION(npts),INTENT(out)      :: t2m_min_daily
98c98
<     REAL(r_std),DIMENSION(kjpindex),INTENT(out)      :: tsurf_daily
---
>     REAL(r_std),DIMENSION(npts),INTENT(out)      :: tsurf_daily
100c100
<     REAL(r_std),DIMENSION(kjpindex,nbdl),INTENT(out) :: tsoil_daily
---
>     REAL(r_std),DIMENSION(npts,nbdl),INTENT(out) :: tsoil_daily
102c102
<     REAL(r_std),DIMENSION(kjpindex,nbdl),INTENT(out) :: soilhum_daily
---
>     REAL(r_std),DIMENSION(npts,nbdl),INTENT(out) :: soilhum_daily
104c104
<     REAL(r_std),DIMENSION(kjpindex),INTENT(out)      :: precip_daily
---
>     REAL(r_std),DIMENSION(npts),INTENT(out)      :: precip_daily
106c106
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: gpp_daily
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out) :: gpp_daily
108c108
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: npp_daily
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out) :: npp_daily
110c110
<     REAL(r_std),DIMENSION(kjpindex,nvm,nparts),INTENT(out) :: turnover_daily
---
>     REAL(r_std),DIMENSION(npts,nvm,nparts),INTENT(out) :: turnover_daily
112c112
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: moiavail_month
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out) :: moiavail_month
114c114
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: moiavail_week
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out) :: moiavail_week
116c116
<     REAL(r_std),DIMENSION(kjpindex),INTENT(out)      :: t2m_longterm
---
>     REAL(r_std),DIMENSION(npts),INTENT(out)      :: t2m_longterm
118c118
<     REAL(r_std),DIMENSION(kjpindex),INTENT(out)      :: t2m_month
---
>     REAL(r_std),DIMENSION(npts),INTENT(out)      :: t2m_month
120c120
<     REAL(r_std),DIMENSION(kjpindex),INTENT(out)      :: t2m_week
---
>     REAL(r_std),DIMENSION(npts),INTENT(out)      :: t2m_week
122c122
<     REAL(r_std),DIMENSION(kjpindex,nbdl),INTENT(out) :: tsoil_month
---
>     REAL(r_std),DIMENSION(npts,nbdl),INTENT(out) :: tsoil_month
124c124
<     REAL(r_std),DIMENSION(kjpindex,nbdl),INTENT(out) :: soilhum_month
---
>     REAL(r_std),DIMENSION(npts,nbdl),INTENT(out) :: soilhum_month
126c126
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: fireindex
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out) :: fireindex
128c128
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: firelitter
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out) :: firelitter
130c130
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: maxmoiavail_lastyear
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out) :: maxmoiavail_lastyear
132c132
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: maxmoiavail_thisyear
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out) :: maxmoiavail_thisyear
134c134
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: minmoiavail_lastyear
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out) :: minmoiavail_lastyear
136c136
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: minmoiavail_thisyear
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out) :: minmoiavail_thisyear
138c138
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: maxgppweek_lastyear
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out) :: maxgppweek_lastyear
140c140
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: maxgppweek_thisyear
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out) :: maxgppweek_thisyear
142c142
<     REAL(r_std),DIMENSION(kjpindex),INTENT(out)      :: gdd0_lastyear
---
>     REAL(r_std),DIMENSION(npts),INTENT(out)      :: gdd0_lastyear
144c144
<     REAL(r_std),DIMENSION(kjpindex),INTENT(out)      :: gdd0_thisyear
---
>     REAL(r_std),DIMENSION(npts),INTENT(out)      :: gdd0_thisyear
146c146
<     REAL(r_std),DIMENSION(kjpindex),INTENT(out)      :: precip_lastyear
---
>     REAL(r_std),DIMENSION(npts),INTENT(out)      :: precip_lastyear
148c148
<     REAL(r_std),DIMENSION(kjpindex),INTENT(out)      :: precip_thisyear
---
>     REAL(r_std),DIMENSION(npts),INTENT(out)      :: precip_thisyear
150c150
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: gdd_m5_dormance
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out) :: gdd_m5_dormance
152c152
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: gdd_midwinter
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out) :: gdd_midwinter
154c154
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: ncd_dormance
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out) :: ncd_dormance
156c156
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: ngd_minus5
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out) :: ngd_minus5
158c158
<     LOGICAL,DIMENSION(kjpindex,nvm),INTENT(out)    :: PFTpresent
---
>     LOGICAL,DIMENSION(npts,nvm),INTENT(out)    :: PFTpresent
160c160
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: npp_longterm
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out) :: npp_longterm
162c162
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: lm_lastyearmax
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out) :: lm_lastyearmax
164c164
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: lm_thisyearmax
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out) :: lm_thisyearmax
166c166
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: maxfpc_lastyear
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out) :: maxfpc_lastyear
169c169
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: maxfpc_thisyear
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out) :: maxfpc_thisyear
171c171
<     REAL(r_std),DIMENSION(kjpindex,nvm,nparts),INTENT(out) :: turnover_longterm
---
>     REAL(r_std),DIMENSION(npts,nvm,nparts),INTENT(out) :: turnover_longterm
173c173
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: gpp_week
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out) :: gpp_week
175c175
<     REAL(r_std),DIMENSION(kjpindex,nvm,nparts),INTENT(out) :: biomass
---
>     REAL(r_std),DIMENSION(npts,nvm,nparts),INTENT(out) :: biomass
177c177
<     REAL(r_std),DIMENSION(kjpindex,nvm,nparts),INTENT(out) :: resp_maint_part
---
>     REAL(r_std),DIMENSION(npts,nvm,nparts),INTENT(out) :: resp_maint_part
179c179
<     REAL(r_std),DIMENSION(kjpindex,nvm,nleafages),INTENT(out) :: leaf_age
---
>     REAL(r_std),DIMENSION(npts,nvm,nleafages),INTENT(out) :: leaf_age
181c181
<     REAL(r_std),DIMENSION(kjpindex,nvm,nleafages),INTENT(out) :: leaf_frac
---
>     REAL(r_std),DIMENSION(npts,nvm,nleafages),INTENT(out) :: leaf_frac
184c184
<     LOGICAL,DIMENSION(kjpindex,nvm),INTENT(out) :: senescence
---
>     LOGICAL,DIMENSION(npts,nvm),INTENT(out) :: senescence
186c186
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: when_growthinit
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out) :: when_growthinit
188c188
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: age
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out) :: age
190c190
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: resp_hetero
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out) :: resp_hetero
192c192
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: resp_maint
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out) :: resp_maint
194c194
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: resp_growth
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out) :: resp_growth
197c197
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: co2_fire
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out) :: co2_fire
199c199
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: co2_to_bm_dgvm
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out) :: co2_to_bm_dgvm
201c201
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: veget_lastlight
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out) :: veget_lastlight
204c204
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: everywhere
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out) :: everywhere
207c207
<     LOGICAL,DIMENSION(kjpindex,nvm),INTENT(out) :: need_adjacent
---
>     LOGICAL,DIMENSION(npts,nvm),INTENT(out) :: need_adjacent
209c209
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: RIP_time
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out) :: RIP_time
211c211
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: time_lowgpp
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out) :: time_lowgpp
213c213
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: time_hum_min
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out) :: time_hum_min
215c215
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: hum_min_dormance
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out) :: hum_min_dormance
218c218
<     REAL(r_std),DIMENSION(kjpindex,nvm,nlitt),INTENT(out) :: litterpart
---
>     REAL(r_std),DIMENSION(npts,nvm,nlitt),INTENT(out) :: litterpart
221c221
<     REAL(r_std),DIMENSION(kjpindex,nlitt,nvm,nlevs),INTENT(out):: litter
---
>     REAL(r_std),DIMENSION(npts,nlitt,nvm,nlevs),INTENT(out):: litter
224c224
<     REAL(r_std),DIMENSION(kjpindex,nvm,nlitt),INTENT(out) :: dead_leaves
---
>     REAL(r_std),DIMENSION(npts,nvm,nlitt),INTENT(out) :: dead_leaves
226c226
<     REAL(r_std),DIMENSION(kjpindex,ncarb,nvm),INTENT(out) :: carbon
---
>     REAL(r_std),DIMENSION(npts,ncarb,nvm),INTENT(out) :: carbon
228c228
<     REAL(r_std),DIMENSION(kjpindex),INTENT(out)                 :: black_carbon
---
>     REAL(r_std),DIMENSION(npts),INTENT(out)                 :: black_carbon
230,231c230,231
<     REAL(r_std),DIMENSION(kjpindex,nvm,nlevs),INTENT(out) :: lignin_struc
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: turnover_time
---
>     REAL(r_std),DIMENSION(npts,nvm,nlevs),INTENT(out) :: lignin_struc
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(out) :: turnover_time
236c236
<     REAL(r_std),DIMENSION(kjpindex),INTENT(inout) :: tlong_ref
---
>     REAL(r_std),DIMENSION(npts),INTENT(inout) :: tlong_ref
243c243
<     REAL(r_std),DIMENSION(kjpindex,nvm) :: PFTpresent_real
---
>     REAL(r_std),DIMENSION(npts,nvm) :: PFTpresent_real
246c246
<     REAL(r_std),DIMENSION(kjpindex,nvm) :: senescence_real
---
>     REAL(r_std),DIMENSION(npts,nvm) :: senescence_real
249c249
<     REAL(r_std),DIMENSION(kjpindex,nvm) :: need_adjacent_real
---
>     REAL(r_std),DIMENSION(npts,nvm) :: need_adjacent_real
263c263
<     REAL(r_std),DIMENSION(kjpindex) :: tref
---
>     REAL(r_std),DIMENSION(npts) :: tref
268,269c268,269
<     REAL(r_std),DIMENSION(kjpindex,0:10),INTENT(out)                           :: prod10
<     REAL(r_std),DIMENSION(kjpindex,0:100),INTENT(out)                          :: prod100
---
>     REAL(r_std),DIMENSION(npts,0:10),INTENT(out)                           :: prod10
>     REAL(r_std),DIMENSION(npts,0:100),INTENT(out)                          :: prod100
271,277c271,277
<     REAL(r_std),DIMENSION(kjpindex,10),INTENT(out)                           :: flux10
<     REAL(r_std),DIMENSION(kjpindex,100),INTENT(out)                          :: flux100
<     REAL(r_std), DIMENSION(kjpindex), INTENT(out)                            :: convflux
<     REAL(r_std), DIMENSION(kjpindex), INTENT(out)                            :: cflux_prod10
<     REAL(r_std), DIMENSION(kjpindex), INTENT(out)                            :: cflux_prod100
<     REAL(r_std),DIMENSION(kjpindex,nvm,nparts),INTENT(out)                   :: bm_to_litter
<     REAL(r_std),DIMENSION(kjpindex),INTENT(out)                              :: carb_mass_total
---
>     REAL(r_std),DIMENSION(npts,10),INTENT(out)                           :: flux10
>     REAL(r_std),DIMENSION(npts,100),INTENT(out)                          :: flux100
>     REAL(r_std), DIMENSION(npts), INTENT(out)                            :: convflux
>     REAL(r_std), DIMENSION(npts), INTENT(out)                            :: cflux_prod10
>     REAL(r_std), DIMENSION(npts), INTENT(out)                            :: cflux_prod100
>     REAL(r_std),DIMENSION(npts,nvm,nparts),INTENT(out)                   :: bm_to_litter
>     REAL(r_std),DIMENSION(npts),INTENT(out)                              :: carb_mass_total
287c287
<     CALL get_reftemp( kjpindex, lalo, resolution, tref )
---
>     CALL get_reftemp( npts, lalo, resolution, tref )
957c957
<        & (kjpindex, index, day_counter, dt_days, date, &
---
>        & (npts, index, day_counter, dt_days, date, &
990c990
<     INTEGER(i_std),INTENT(in) :: kjpindex
---
>     INTEGER(i_std),INTENT(in) :: npts
992c992
<     INTEGER(i_std),DIMENSION(kjpindex),INTENT(in) :: index
---
>     INTEGER(i_std),DIMENSION(npts),INTENT(in) :: index
1000c1000
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: ind
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: ind
1002c1002
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: adapted
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: adapted
1004c1004
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: regenerate
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: regenerate
1006c1006
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: moiavail_daily
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: moiavail_daily
1008c1008
<     REAL(r_std),DIMENSION(kjpindex),INTENT(in) :: litterhum_daily
---
>     REAL(r_std),DIMENSION(npts),INTENT(in) :: litterhum_daily
1010c1010
<     REAL(r_std),DIMENSION(kjpindex),INTENT(in) :: t2m_daily
---
>     REAL(r_std),DIMENSION(npts),INTENT(in) :: t2m_daily
1012c1012
<     REAL(r_std),DIMENSION(kjpindex),INTENT(in) :: t2m_min_daily
---
>     REAL(r_std),DIMENSION(npts),INTENT(in) :: t2m_min_daily
1014c1014
<     REAL(r_std),DIMENSION(kjpindex),INTENT(in) :: tsurf_daily
---
>     REAL(r_std),DIMENSION(npts),INTENT(in) :: tsurf_daily
1016c1016
<     REAL(r_std),DIMENSION(kjpindex,nbdl),INTENT(in) :: tsoil_daily
---
>     REAL(r_std),DIMENSION(npts,nbdl),INTENT(in) :: tsoil_daily
1018c1018
<     REAL(r_std),DIMENSION(kjpindex,nbdl),INTENT(in) :: soilhum_daily
---
>     REAL(r_std),DIMENSION(npts,nbdl),INTENT(in) :: soilhum_daily
1020c1020
<     REAL(r_std),DIMENSION(kjpindex),INTENT(in) :: precip_daily
---
>     REAL(r_std),DIMENSION(npts),INTENT(in) :: precip_daily
1022c1022
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: gpp_daily
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: gpp_daily
1024c1024
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: npp_daily
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: npp_daily
1026c1026
<     REAL(r_std),DIMENSION(kjpindex,nvm,nparts),INTENT(in) :: turnover_daily
---
>     REAL(r_std),DIMENSION(npts,nvm,nparts),INTENT(in) :: turnover_daily
1028c1028
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: moiavail_month
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: moiavail_month
1030c1030
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: moiavail_week
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: moiavail_week
1032c1032
<     REAL(r_std),DIMENSION(kjpindex),INTENT(in) :: t2m_longterm
---
>     REAL(r_std),DIMENSION(npts),INTENT(in) :: t2m_longterm
1034c1034
<     REAL(r_std),DIMENSION(kjpindex),INTENT(in) :: tlong_ref
---
>     REAL(r_std),DIMENSION(npts),INTENT(in) :: tlong_ref
1036c1036
<     REAL(r_std),DIMENSION(kjpindex),INTENT(in) :: t2m_month
---
>     REAL(r_std),DIMENSION(npts),INTENT(in) :: t2m_month
1038c1038
<     REAL(r_std),DIMENSION(kjpindex),INTENT(in) :: t2m_week
---
>     REAL(r_std),DIMENSION(npts),INTENT(in) :: t2m_week
1040c1040
<     REAL(r_std),DIMENSION(kjpindex,nbdl),INTENT(in) :: tsoil_month
---
>     REAL(r_std),DIMENSION(npts,nbdl),INTENT(in) :: tsoil_month
1042c1042
<     REAL(r_std),DIMENSION(kjpindex,nbdl),INTENT(in) :: soilhum_month
---
>     REAL(r_std),DIMENSION(npts,nbdl),INTENT(in) :: soilhum_month
1044c1044
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: fireindex
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: fireindex
1046c1046
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: firelitter
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: firelitter
1048c1048
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: maxmoiavail_lastyear
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: maxmoiavail_lastyear
1050c1050
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: maxmoiavail_thisyear
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: maxmoiavail_thisyear
1052c1052
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: minmoiavail_lastyear
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: minmoiavail_lastyear
1054c1054
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: minmoiavail_thisyear
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: minmoiavail_thisyear
1056c1056
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: maxgppweek_lastyear
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: maxgppweek_lastyear
1058c1058
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: maxgppweek_thisyear
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: maxgppweek_thisyear
1060c1060
<     REAL(r_std),DIMENSION(kjpindex),INTENT(in) :: gdd0_lastyear
---
>     REAL(r_std),DIMENSION(npts),INTENT(in) :: gdd0_lastyear
1062c1062
<     REAL(r_std),DIMENSION(kjpindex),INTENT(in) :: gdd0_thisyear
---
>     REAL(r_std),DIMENSION(npts),INTENT(in) :: gdd0_thisyear
1064c1064
<     REAL(r_std),DIMENSION(kjpindex),INTENT(in) :: precip_lastyear
---
>     REAL(r_std),DIMENSION(npts),INTENT(in) :: precip_lastyear
1066c1066
<     REAL(r_std),DIMENSION(kjpindex),INTENT(in) :: precip_thisyear
---
>     REAL(r_std),DIMENSION(npts),INTENT(in) :: precip_thisyear
1068c1068
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: gdd_m5_dormance
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: gdd_m5_dormance
1070c1070
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: gdd_midwinter
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: gdd_midwinter
1072c1072
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: ncd_dormance
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: ncd_dormance
1074c1074
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: ngd_minus5
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: ngd_minus5
1076c1076
<     LOGICAL,DIMENSION(kjpindex,nvm),INTENT(in) :: PFTpresent
---
>     LOGICAL,DIMENSION(npts,nvm),INTENT(in) :: PFTpresent
1078c1078
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: npp_longterm
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: npp_longterm
1080c1080
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: lm_lastyearmax
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: lm_lastyearmax
1082c1082
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: lm_thisyearmax
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: lm_thisyearmax
1084c1084
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: maxfpc_lastyear
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: maxfpc_lastyear
1087c1087
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: maxfpc_thisyear
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: maxfpc_thisyear
1089c1089
<     REAL(r_std),DIMENSION(kjpindex,nvm,nparts),INTENT(in) :: turnover_longterm
---
>     REAL(r_std),DIMENSION(npts,nvm,nparts),INTENT(in) :: turnover_longterm
1091c1091
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: gpp_week
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: gpp_week
1093c1093
<     REAL(r_std),DIMENSION(kjpindex,nvm,nparts),INTENT(in) :: biomass
---
>     REAL(r_std),DIMENSION(npts,nvm,nparts),INTENT(in) :: biomass
1095c1095
<     REAL(r_std),DIMENSION(kjpindex,nvm,nparts),INTENT(in) :: resp_maint_part
---
>     REAL(r_std),DIMENSION(npts,nvm,nparts),INTENT(in) :: resp_maint_part
1097c1097
<     REAL(r_std),DIMENSION(kjpindex,nvm,nleafages),INTENT(in) :: leaf_age
---
>     REAL(r_std),DIMENSION(npts,nvm,nleafages),INTENT(in) :: leaf_age
1099c1099
<     REAL(r_std),DIMENSION(kjpindex,nvm,nleafages),INTENT(in) :: leaf_frac
---
>     REAL(r_std),DIMENSION(npts,nvm,nleafages),INTENT(in) :: leaf_frac
1102c1102
<     LOGICAL,DIMENSION(kjpindex,nvm),INTENT(in) :: senescence
---
>     LOGICAL,DIMENSION(npts,nvm),INTENT(in) :: senescence
1104c1104
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: when_growthinit
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: when_growthinit
1106c1106
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: age
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: age
1108c1108
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: resp_hetero
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: resp_hetero
1110c1110
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: resp_maint
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: resp_maint
1112c1112
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: resp_growth
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: resp_growth
1115c1115
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: co2_fire
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: co2_fire
1117c1117
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: co2_to_bm_dgvm
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: co2_to_bm_dgvm
1119c1119
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: veget_lastlight
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: veget_lastlight
1122c1122
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: everywhere
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: everywhere
1125c1125
<     LOGICAL,DIMENSION(kjpindex,nvm),INTENT(in) :: need_adjacent
---
>     LOGICAL,DIMENSION(npts,nvm),INTENT(in) :: need_adjacent
1127c1127
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: RIP_time
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: RIP_time
1129c1129
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: time_lowgpp
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: time_lowgpp
1131c1131
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: time_hum_min
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: time_hum_min
1133c1133
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: hum_min_dormance
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: hum_min_dormance
1135c1135
<     REAL(r_std),DIMENSION(kjpindex,nvm,nlitt),INTENT(in) :: litterpart
---
>     REAL(r_std),DIMENSION(npts,nvm,nlitt),INTENT(in) :: litterpart
1137c1137
<     REAL(r_std),DIMENSION(kjpindex,nlitt,nvm,nlevs),INTENT(in) :: litter
---
>     REAL(r_std),DIMENSION(npts,nlitt,nvm,nlevs),INTENT(in) :: litter
1140c1140
<     REAL(r_std),DIMENSION(kjpindex,nvm,nlitt),INTENT(in) :: dead_leaves
---
>     REAL(r_std),DIMENSION(npts,nvm,nlitt),INTENT(in) :: dead_leaves
1142c1142
<     REAL(r_std),DIMENSION(kjpindex,ncarb,nvm),INTENT(in) :: carbon
---
>     REAL(r_std),DIMENSION(npts,ncarb,nvm),INTENT(in) :: carbon
1144c1144
<     REAL(r_std),DIMENSION(kjpindex),INTENT(in) :: black_carbon
---
>     REAL(r_std),DIMENSION(npts),INTENT(in) :: black_carbon
1146c1146
<     REAL(r_std),DIMENSION(kjpindex,nvm,nlevs),INTENT(in) :: lignin_struc
---
>     REAL(r_std),DIMENSION(npts,nvm,nlevs),INTENT(in) :: lignin_struc
1148c1148
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in) :: turnover_time
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: turnover_time
1155c1155
<     REAL(r_std),DIMENSION(kjpindex,nvm) :: PFTpresent_real
---
>     REAL(r_std),DIMENSION(npts,nvm) :: PFTpresent_real
1158c1158
<     REAL(r_std),DIMENSION(kjpindex,nvm) :: senescence_real
---
>     REAL(r_std),DIMENSION(npts,nvm) :: senescence_real
1161c1161
<     REAL(r_std),DIMENSION(kjpindex,nvm) :: need_adjacent_real
---
>     REAL(r_std),DIMENSION(npts,nvm) :: need_adjacent_real
1178,1179c1178,1179
<     REAL(r_std),DIMENSION(kjpindex,0:10),INTENT(in)                           :: prod10
<     REAL(r_std),DIMENSION(kjpindex,0:100),INTENT(in)                          :: prod100
---
>     REAL(r_std),DIMENSION(npts,0:10),INTENT(in)                           :: prod10
>     REAL(r_std),DIMENSION(npts,0:100),INTENT(in)                          :: prod100
1181,1187c1181,1187
<     REAL(r_std),DIMENSION(kjpindex,10),INTENT(in)                           :: flux10
<     REAL(r_std),DIMENSION(kjpindex,100),INTENT(in)                          :: flux100
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                            :: convflux
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                            :: cflux_prod10
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                            :: cflux_prod100
<     REAL(r_std),DIMENSION(kjpindex,nvm,nparts),INTENT(in)                   :: bm_to_litter
<     REAL(r_std),DIMENSION(kjpindex),INTENT(in)                              :: carb_mass_total
---
>     REAL(r_std),DIMENSION(npts,10),INTENT(in)                           :: flux10
>     REAL(r_std),DIMENSION(npts,100),INTENT(in)                          :: flux100
>     REAL(r_std), DIMENSION(npts), INTENT(in)                            :: convflux
>     REAL(r_std), DIMENSION(npts), INTENT(in)                            :: cflux_prod10
>     REAL(r_std), DIMENSION(npts), INTENT(in)                            :: cflux_prod100
>     REAL(r_std),DIMENSION(npts,nvm,nparts),INTENT(in)                   :: bm_to_litter
>     REAL(r_std),DIMENSION(npts),INTENT(in)                              :: carb_mass_total
1662c1662
<   SUBROUTINE readbc (kjpindex, lalo, resolution, tref)
---
>   SUBROUTINE readbc (npts, lalo, resolution, tref)
1668c1668
<     INTEGER(i_std),INTENT(in) :: kjpindex
---
>     INTEGER(i_std),INTENT(in) :: npts
1670c1670
<     REAL(r_std),DIMENSION (kjpindex,2),INTENT(in) :: lalo
---
>     REAL(r_std),DIMENSION (npts,2),INTENT(in) :: lalo
1672c1672
<     REAL(r_std),DIMENSION (kjpindex,2),INTENT(in) :: resolution
---
>     REAL(r_std),DIMENSION (npts,2),INTENT(in) :: resolution
1677c1677
<     REAL(r_std),DIMENSION(kjpindex),INTENT(inout) :: tref
---
>     REAL(r_std),DIMENSION(npts),INTENT(inout) :: tref
1684c1684
<        CALL get_reftemp (kjpindex, lalo, resolution, tref)
---
>        CALL get_reftemp (npts, lalo, resolution, tref)
1693c1693
<     firstcall_io=.TRUE.
---
>     firstcall=.TRUE.
1700c1700
<   SUBROUTINE get_reftemp (kjpindex, lalo, resolution, tref_out)
---
>   SUBROUTINE get_reftemp (npts, lalo, resolution, tref_out)
1715c1715
<     INTEGER(i_std),INTENT(in) :: kjpindex
---
>     INTEGER(i_std),INTENT(in) :: npts
1717c1717
<     REAL(r_std),DIMENSION (kjpindex,2),INTENT(in) :: lalo
---
>     REAL(r_std),DIMENSION (npts,2),INTENT(in) :: lalo
1719c1719
<     REAL(r_std),DIMENSION (kjpindex,2),INTENT(in) :: resolution
---
>     REAL(r_std),DIMENSION (npts,2),INTENT(in) :: resolution
1724c1724
<     REAL(r_std), DIMENSION(kjpindex),INTENT(out) :: tref_out
---
>     REAL(r_std), DIMENSION(npts),INTENT(out) :: tref_out
1732c1732
<     REAL(r_std) :: lev(1), date, dt_days, coslat
---
>     REAL(r_std) :: lev(1), date, dt, coslat
1751c1751
<     IF (firstcall_io) THEN
---
>     IF (firstcall) THEN
1755c1755
<        firstcall_io = .FALSE.
---
>        firstcall = .FALSE.
1759c1759
<        ALLOCATE( trefe(kjpindex) )
---
>        ALLOCATE( trefe(npts) )
1798c1798
<             &                                   lon_rel, lat_rel, lev, tml, itau, date, dt_days, fid)
---
>             &                                   lon_rel, lat_rel, lev, tml, itau, date, dt, fid)
1803c1803
<        CALL bcast(dt_days)
---
>        CALL bcast(dt)
1870c1870
<        DO ib=1,kjpindex
---
>        DO ib=1,npts
diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile /login/IPSL_CODE/AssimilBranche/modeles/ORCHIDEE/src_stomate/stomate_lcchange.f90 /login/IPSL_CODE/ORCHIDEE_1_9_5_2/modeles/ORCHIDEE/src_stomate/stomate_lcchange.f90
32c32
<   SUBROUTINE lcchange_main ( kjpindex, dt_days, veget_max, veget_max_new,&
---
>   SUBROUTINE lcchange_main ( npts, dt_days, veget_max, veget_max_new,&
34c34
<        co2_to_bm_dgvm, bm_to_litter, turnover_daily, cn_ind,flux10,flux100, &
---
>        co2_to_bm, bm_to_litter, turnover_daily, bm_sapl, tree, cn_ind,flux10,flux100, &
48c48
<     INTEGER, INTENT(in)                                            :: kjpindex
---
>     INTEGER, INTENT(in)                                            :: npts
54c54,59
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(INOUT)                 :: veget_max_new
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(INOUT)                 :: veget_max_new
>     ! biomass of sapling (gC/individu)
>     REAL(r_std) , DIMENSION (nvm, nparts), INTENT(in)              :: bm_sapl
> 
>     ! is pft a tree
>     LOGICAL, DIMENSION(nvm), INTENT(in)                           :: tree
60c65
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)                    :: veget
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)                    :: veget
63c68
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)                    :: veget_max
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)                    :: veget_max
66c71
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts), INTENT(inout)             :: biomass
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(inout)             :: biomass
69c74
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)                    :: ind
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)                    :: ind
72c77
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)                    :: age
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)                    :: age
76c81
<     LOGICAL, DIMENSION(kjpindex,nvm), INTENT(inout)                       :: senescence
---
>     LOGICAL, DIMENSION(npts,nvm), INTENT(inout)                       :: senescence
79c84
<     LOGICAL, DIMENSION(kjpindex,nvm), INTENT(inout)                       :: PFTpresent
---
>     LOGICAL, DIMENSION(npts,nvm), INTENT(inout)                       :: PFTpresent
82c87
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)                    :: everywhere
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)                    :: everywhere
85c90
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)                    :: when_growthinit
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)                    :: when_growthinit
90c95
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)                       :: co2_to_bm_dgvm
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)                       :: co2_to_bm
93c98
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts), INTENT(inout)           :: bm_to_litter
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(inout)           :: bm_to_litter
96c101
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)                   :: cn_ind
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)                   :: cn_ind
100,101c105,106
<     REAL(r_std), DIMENSION(kjpindex,0:10), INTENT(inout)                     :: prod10
<     REAL(r_std), DIMENSION(kjpindex,0:100), INTENT(inout)                    :: prod100
---
>     REAL(r_std), DIMENSION(npts,0:10), INTENT(inout)                     :: prod10
>     REAL(r_std), DIMENSION(npts,0:100), INTENT(inout)                    :: prod100
104,105c109,110
<     REAL(r_std), DIMENSION(kjpindex,10), INTENT(inout)                     :: flux10
<     REAL(r_std), DIMENSION(kjpindex,100), INTENT(inout)                    :: flux100 
---
>     REAL(r_std), DIMENSION(npts,10), INTENT(inout)                     :: flux10
>     REAL(r_std), DIMENSION(npts,100), INTENT(inout)                    :: flux100 
108c113
<     REAL(r_std), DIMENSION(kjpindex,nvm,nleafages), INTENT(inout)         :: leaf_frac
---
>     REAL(r_std), DIMENSION(npts,nvm,nleafages), INTENT(inout)         :: leaf_frac
111c116
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)                   :: lm_lastyearmax
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)                   :: lm_lastyearmax
114c119
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)                    :: npp_longterm
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)                    :: npp_longterm
117c122
<     REAL(r_std),DIMENSION(kjpindex,nlitt,nvm,nlevs), INTENT(inout)         :: litter
---
>     REAL(r_std),DIMENSION(npts,nlitt,nvm,nlevs), INTENT(inout)         :: litter
119c124
<     REAL(r_std),DIMENSION(kjpindex,ncarb,nvm), INTENT(inout)               :: carbon
---
>     REAL(r_std),DIMENSION(npts,ncarb,nvm), INTENT(inout)               :: carbon
124c129
<     REAL(r_std), DIMENSION(kjpindex), INTENT(out)                          :: convflux
---
>     REAL(r_std), DIMENSION(npts), INTENT(out)                          :: convflux
127c132
<     REAL(r_std), DIMENSION(kjpindex), INTENT(out)                          :: cflux_prod10, cflux_prod100
---
>     REAL(r_std), DIMENSION(npts), INTENT(out)                          :: cflux_prod10, cflux_prod100
130c135
< !!$    REAL(r_std), DIMENSION(kjpindex), INTENT(out)                          :: prod10_total, prod100_total 
---
> !!$    REAL(r_std), DIMENSION(npts), INTENT(out)                          :: prod10_total, prod100_total 
133c138
< !!$    REAL(r_std), DIMENSION(kjpindex), INTENT(out)                          :: cflux_prod_total
---
> !!$    REAL(r_std), DIMENSION(npts), INTENT(out)                          :: cflux_prod_total
136c141
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts), INTENT(inout)               :: turnover_daily
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(inout)               :: turnover_daily
146c151
<     REAL(r_std),DIMENSION(kjpindex,nparts)                                 :: biomass_loss
---
>     REAL(r_std),DIMENSION(npts,nparts)                                 :: biomass_loss
149c154
<     REAL(r_std),DIMENSION(kjpindex,nlitt,nlevs)                            :: dilu_lit
---
>     REAL(r_std),DIMENSION(npts,nlitt,nlevs)                            :: dilu_lit
151c156
<     REAL(r_std),DIMENSION(kjpindex,ncarb)                                  :: dilu_soil_carbon
---
>     REAL(r_std),DIMENSION(npts,ncarb)                                  :: dilu_soil_carbon
158c163
<     REAL(r_std),DIMENSION(kjpindex,nvm)                                    :: delta_ind 
---
>     REAL(r_std),DIMENSION(npts,nvm)                                    :: delta_ind 
178c183
<     DO i = 1, kjpindex  
---
>     DO i = 1, npts  
231c236
<                 co2_to_bm_dgvm(i,j) = co2_to_bm_dgvm(i,j)+  (bm_new* dt_days) / (one_year * veget_max_new(i,j))
---
>                 co2_to_bm(i,j) = co2_to_bm(i,j)+  (bm_new* dt_days) / (one_year * veget_max_new(i,j))
323c328
<     ENDDO  ! End loop on kjpindex
---
>     ENDDO  ! End loop on npts
diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile /login/IPSL_CODE/AssimilBranche/modeles/ORCHIDEE/src_stomate/stomate_litter.f90 /login/IPSL_CODE/ORCHIDEE_1_9_5_2/modeles/ORCHIDEE/src_stomate/stomate_litter.f90
21c21
<   PUBLIC littercalc_main,littercalc_clear, deadleaf
---
>   PUBLIC littercalc,littercalc_clear, deadleaf
24c24
<   LOGICAL, SAVE                                                     :: firstcall_litter = .TRUE.
---
>   LOGICAL, SAVE                                                     :: firstcall = .TRUE.
27,29d26
< ! List of subroutines for initialization :
< !- littercalc_clear
< !- deadleaf
32c29
<     firstcall_litter =.TRUE.
---
>     firstcall =.TRUE.
36,38c33,35
<   SUBROUTINE littercalc_main (kjpindex, dt_days, &
<        turnover_littercalc, bm_to_litter, &
<        veget_max, tsurf_daily, tsoil_daily, shumdiag, litterhumdiag, &
---
>   SUBROUTINE littercalc (npts, dt, &
>        turnover, bm_to_litter, &
>        veget_max, tsurf, tsoil, soilhum, litterhum, &
50c47
<     INTEGER(i_std), INTENT(in)                                               :: kjpindex
---
>     INTEGER(i_std), INTENT(in)                                               :: npts
52c49
<     REAL(r_std), INTENT(in)                                            :: dt_days
---
>     REAL(r_std), INTENT(in)                                            :: dt
54c51
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts), INTENT(in)               :: turnover_littercalc
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(in)               :: turnover
56c53
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts), INTENT(in)               :: bm_to_litter
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(in)               :: bm_to_litter
58c55
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in)                  :: veget_max
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in)                  :: veget_max
60c57
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                           :: tsurf_daily
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                           :: tsurf
62c59
<     REAL(r_std), DIMENSION(kjpindex,nbdl), INTENT(in)                      :: tsoil_daily
---
>     REAL(r_std), DIMENSION(npts,nbdl), INTENT(in)                      :: tsoil
64c61
<     REAL(r_std), DIMENSION(kjpindex,nbdl), INTENT(in)                      :: shumdiag
---
>     REAL(r_std), DIMENSION(npts,nbdl), INTENT(in)                      :: soilhum
66c63
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                           :: litterhumdiag
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                           :: litterhum
71c68
<     REAL(r_std), DIMENSION(kjpindex,nvm,nlitt), INTENT(inout)             :: litterpart
---
>     REAL(r_std), DIMENSION(npts,nvm,nlitt), INTENT(inout)             :: litterpart
73c70
<     REAL(r_std), DIMENSION(kjpindex,nlitt,nvm,nlevs), INTENT(inout)  :: litter
---
>     REAL(r_std), DIMENSION(npts,nlitt,nvm,nlevs), INTENT(inout)  :: litter
76c73
<     REAL(r_std), DIMENSION(kjpindex,nvm,nlitt), INTENT(inout)             :: dead_leaves
---
>     REAL(r_std), DIMENSION(npts,nvm,nlitt), INTENT(inout)             :: dead_leaves
78c75
<     REAL(r_std), DIMENSION(kjpindex,nvm,nlevs), INTENT(inout)        :: lignin_struc
---
>     REAL(r_std), DIMENSION(npts,nvm,nlevs), INTENT(inout)        :: lignin_struc
83c80
<     REAL(r_std), DIMENSION(kjpindex), INTENT(out)                          :: deadleaf_cover
---
>     REAL(r_std), DIMENSION(npts), INTENT(out)                          :: deadleaf_cover
85c82
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(out)                :: resp_hetero_litter
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(out)                :: resp_hetero_litter
88c85
<     REAL(r_std), DIMENSION(kjpindex,ncarb,nvm), INTENT(out)          :: soilcarbon_input
---
>     REAL(r_std), DIMENSION(npts,ncarb,nvm), INTENT(out)          :: soilcarbon_input
90c87
<     REAL(r_std), DIMENSION(kjpindex,nlevs), INTENT(out)                    :: control_temp
---
>     REAL(r_std), DIMENSION(npts,nlevs), INTENT(out)                    :: control_temp
92c89
<     REAL(r_std), DIMENSION(kjpindex,nlevs), INTENT(out)                    :: control_moist
---
>     REAL(r_std), DIMENSION(npts,nlevs), INTENT(out)                    :: control_moist
101a99,100
>     ! soil levels (m)
>     REAL(r_std), SAVE, DIMENSION(0:nbdl)                               :: z_soil
105c104
<     REAL(r_std), DIMENSION(kjpindex)                                       :: rpc
---
>     REAL(r_std), DIMENSION(npts)                                       :: rpc
112c111
<     REAL(r_std), DIMENSION(kjpindex)                                       :: tsoil_decomp
---
>     REAL(r_std), DIMENSION(npts)                                       :: tsoil_decomp
114c113
<     REAL(r_std), DIMENSION(kjpindex)                                       :: soilhum_decomp
---
>     REAL(r_std), DIMENSION(npts)                                       :: soilhum_decomp
116c115
<     REAL(r_std), DIMENSION(kjpindex)                                       :: fd
---
>     REAL(r_std), DIMENSION(npts)                                       :: fd
118c117
<     REAL(r_std), DIMENSION(kjpindex)                                       :: qd
---
>     REAL(r_std), DIMENSION(npts)                                       :: qd
120c119
<     REAL(r_std), DIMENSION(kjpindex,nvm,nlevs)                       :: old_struc
---
>     REAL(r_std), DIMENSION(npts,nvm,nlevs)                       :: old_struc
123c122
<     REAL(r_std), DIMENSION(kjpindex,nvm,nlitt,nlevs)                      :: litter_inc_PFT
---
>     REAL(r_std), DIMENSION(npts,nvm,nlitt,nlevs)                      :: litter_inc_PFT
125c124
<     REAL(r_std), DIMENSION(kjpindex,nlitt,nvm,nlevs)                 :: litter_inc
---
>     REAL(r_std), DIMENSION(npts,nlitt,nvm,nlevs)                 :: litter_inc
127c126
<     REAL(r_std), DIMENSION(kjpindex,nvm,nlevs)                       :: lignin_struc_inc
---
>     REAL(r_std), DIMENSION(npts,nvm,nlevs)                       :: lignin_struc_inc
129c128
<     REAL(r_std), DIMENSION(kjpindex,nvm,nlitt)                            :: litter_pft
---
>     REAL(r_std), DIMENSION(npts,nvm,nlitt)                            :: litter_pft
131c130
<     REAL(r_std), DIMENSION(kjpindex)                                       :: zdiff_min
---
>     REAL(r_std), DIMENSION(npts)                                       :: zdiff_min
148c147
<     IF ( firstcall_litter ) THEN
---
>     IF ( firstcall ) THEN
209a209,215
>        ! 1.2 soil levels
>        !
> 
>        z_soil(0) = zero
>        z_soil(1:nbdl) = diaglev(1:nbdl)
> 
>        !
269,270c275,276
<        firstcall_litter = .FALSE.
<        RETURN
---
>        firstcall = .FALSE.
> 
333,337c339,343
<                litterfrac(ileaf,k) * turnover_littercalc(:,j,ileaf) + &
<                litterfrac(isapabove,k) * turnover_littercalc(:,j,isapabove) + &
<                litterfrac(iheartabove,k) * turnover_littercalc(:,j,iheartabove) + &
<                litterfrac(ifruit,k) * turnover_littercalc(:,j,ifruit) + &
<                litterfrac(icarbres,k) * turnover_littercalc(:,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)
343,345c349,351
<                litterfrac(isapbelow,k) * turnover_littercalc(:,j,isapbelow) + &
<                litterfrac(iheartbelow,k) * turnover_littercalc(:,j,iheartbelow) + &
<                litterfrac(iroot,k) * turnover_littercalc(:,j,iroot)
---
>                litterfrac(isapbelow,k) * turnover(:,j,isapbelow) + &
>                litterfrac(iheartbelow,k) * turnover(:,j,iheartbelow) + &
>                litterfrac(iroot,k) * turnover(:,j,iroot)
356c362
<                litterfrac(ileaf,k) * ( bm_to_litter(:,j,ileaf) + turnover_littercalc(:,j,ileaf) )
---
>                litterfrac(ileaf,k) * ( bm_to_litter(:,j,ileaf) + turnover(:,j,ileaf) )
369,373c375,379
<                   LC(ileaf) * turnover_littercalc(:,j,ileaf) + &
<                   LC(isapabove) * turnover_littercalc(:,j,isapabove) + &
<                   LC(iheartabove) * turnover_littercalc(:,j,iheartabove) + &
<                   LC(ifruit) * turnover_littercalc(:,j,ifruit) + &
<                   LC(icarbres) * turnover_littercalc(:,j,icarbres)
---
>                   LC(ileaf) * turnover(:,j,ileaf) + &
>                   LC(isapabove) * turnover(:,j,isapabove) + &
>                   LC(iheartabove) * turnover(:,j,iheartabove) + &
>                   LC(ifruit) * turnover(:,j,ifruit) + &
>                   LC(icarbres) * turnover(:,j,icarbres)
380,382c386,388
<                   LC(isapbelow)*turnover_littercalc(:,j,isapbelow) + &
<                   LC(iheartbelow)*turnover_littercalc(:,j,iheartbelow) + &
<                   LC(iroot)*turnover_littercalc(:,j,iroot)
---
>                   LC(isapbelow)*turnover(:,j,isapbelow) + &
>                   LC(iheartbelow)*turnover(:,j,iheartbelow) + &
>                   LC(iroot)*turnover(:,j,iroot)
454c460
<     control_temp(:,iabove) = control_temp_func (kjpindex, tsurf_daily)
---
>     control_temp(:,iabove) = control_temp_func (npts, tsurf)
471c477
<             tsoil_decomp(:) + tsoil_daily(:,l) * rpc(:) * &
---
>             tsoil_decomp(:) + tsoil(:,l) * rpc(:) * &
476c482
<     control_temp(:,ibelow) = control_temp_func (kjpindex, tsoil_decomp)
---
>     control_temp(:,ibelow) = control_temp_func (npts, tsoil_decomp)
486c492
<     control_moist(:,iabove) = control_moist_func (kjpindex, litterhumdiag)
---
>     control_moist(:,iabove) = control_moist_func (npts, litterhum)
503c509
<             soilhum_decomp(:) + shumdiag(:,l) * rpc(:) * &
---
>             soilhum_decomp(:) + soilhum(:,l) * rpc(:) * &
508c514
<     control_moist(:,ibelow) = control_moist_func (kjpindex, soilhum_decomp)
---
>     control_moist(:,ibelow) = control_moist_func (npts, soilhum_decomp)
523c529
<           fd(:) = dt_days/litter_tau(istructural) * &
---
>           fd(:) = dt/litter_tau(istructural) * &
541c547
<                frac_soil(istructural,iactive,l) * qd(:) * ( 1. - lignin_struc(:,m,l) ) / dt_days
---
>                frac_soil(istructural,iactive,l) * qd(:) * ( 1. - lignin_struc(:,m,l) ) / dt
545c551
<                ( 1. - lignin_struc(:,m,l) ) / dt_days
---
>                ( 1. - lignin_struc(:,m,l) ) / dt
551c557
<                frac_soil(istructural,islow,l) * qd(:) * lignin_struc(:,m,l) / dt_days
---
>                frac_soil(istructural,islow,l) * qd(:) * lignin_struc(:,m,l) / dt
554c560
<                ( 1. - frac_soil(istructural,islow,l) ) * qd(:) * lignin_struc(:,m,l) / dt_days
---
>                ( 1. - frac_soil(istructural,islow,l) ) * qd(:) * lignin_struc(:,m,l) / dt
562c568
<           fd(:) = dt_days/litter_tau(imetabolic) * control_temp(:,l) * control_moist(:,l)
---
>           fd(:) = dt/litter_tau(imetabolic) * control_temp(:,l) * control_moist(:,l)
578c584
<                frac_soil(imetabolic,iactive,l) * qd(:) / dt_days
---
>                frac_soil(imetabolic,iactive,l) * qd(:) / dt
581c587
<                ( 1. - frac_soil(imetabolic,iactive,l) ) * qd(:) / dt_days
---
>                ( 1. - frac_soil(imetabolic,iactive,l) ) * qd(:) / dt
590c596
<     CALL deadleaf (kjpindex, veget_max, dead_leaves, deadleaf_cover)
---
>     CALL deadleaf (npts, veget_max, dead_leaves, deadleaf_cover)
594c600
<   END SUBROUTINE littercalc_main
---
>   END SUBROUTINE littercalc
596c602
<   SUBROUTINE deadleaf (kjpindex, veget_max, dead_leaves, deadleaf_cover)
---
>   SUBROUTINE deadleaf (npts, veget_max, dead_leaves, deadleaf_cover)
605c611
<     INTEGER(i_std), INTENT(in)                                               :: kjpindex
---
>     INTEGER(i_std), INTENT(in)                                               :: npts
608c614
<     REAL(r_std), DIMENSION(kjpindex,nvm,nlitt), INTENT(in)                :: dead_leaves
---
>     REAL(r_std), DIMENSION(npts,nvm,nlitt), INTENT(in)                :: dead_leaves
610c616
<     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(in)                 :: veget_max
---
>     REAL(r_std),DIMENSION(npts,nvm),INTENT(in)                 :: veget_max
613c619
<     REAL(r_std), DIMENSION(kjpindex), INTENT(out)                          :: deadleaf_cover
---
>     REAL(r_std), DIMENSION(npts), INTENT(out)                          :: deadleaf_cover
618c624
<     REAL(r_std), DIMENSION(kjpindex)                                       :: dead_lai
---
>     REAL(r_std), DIMENSION(npts)                                       :: dead_lai
643c649
<   FUNCTION control_moist_func (kjpindex, moist_in) RESULT (moistfunc_result)
---
>   FUNCTION control_moist_func (npts, moist_in) RESULT (moistfunc_result)
652c658
<     INTEGER(i_std), INTENT(in)                                               :: kjpindex
---
>     INTEGER(i_std), INTENT(in)                                               :: npts
654c660
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                           :: moist_in
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                           :: moist_in
659c665
<     REAL(r_std), DIMENSION(kjpindex)                                       :: moistfunc_result
---
>     REAL(r_std), DIMENSION(npts)                                       :: moistfunc_result
666c672
<   FUNCTION control_temp_func (kjpindex, temp_in) RESULT (tempfunc_result)
---
>   FUNCTION control_temp_func (npts, temp_in) RESULT (tempfunc_result)
675c681
<     INTEGER(i_std), INTENT(in)                                               :: kjpindex
---
>     INTEGER(i_std), INTENT(in)                                               :: npts
677c683
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                           :: temp_in
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                           :: temp_in
682c688
<     REAL(r_std), DIMENSION(kjpindex)                                       :: tempfunc_result
---
>     REAL(r_std), DIMENSION(npts)                                       :: tempfunc_result
diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile /login/IPSL_CODE/AssimilBranche/modeles/ORCHIDEE/src_stomate/stomate_lpj.f90 /login/IPSL_CODE/ORCHIDEE_1_9_5_2/modeles/ORCHIDEE/src_stomate/stomate_lpj.f90
47,55c47
<   PUBLIC StomateLpj_main,StomateLpj_clear
< 
<   ! crown area of individuals (m**2)
<   REAL(r_std), ALLOCATABLE, DIMENSION(:,:)                 :: cn_ind
<   ! woodmass of individuals (gC)
<   REAL(r_std), ALLOCATABLE, DIMENSION(:,:)                 :: woodmass_ind
<   ! "maximal" coverage fraction of a PFT (LAI -> infinity) on ground
<   REAL(r_std), ALLOCATABLE, DIMENSION(:,:)                 :: veget_max_old
< 
---
>   PUBLIC StomateLpj,StomateLpj_clear
58c50
<   LOGICAL, SAVE                                           :: firstcall_lpj = .TRUE.
---
>   LOGICAL, SAVE                                           :: firstcall = .TRUE.
61,62d52
< ! List of subroutines for initialization :
< !- StomateLpj_clear
66,69d55
<     IF (ALLOCATED(cn_ind)) DEALLOCATE(cn_ind)
<     IF (ALLOCATED(woodmass_ind)) DEALLOCATE(woodmass_ind)
<     IF (ALLOCATED(veget_max_old)) DEALLOCATE(veget_max_old)
< 
82d67
< 
85c70
<   SUBROUTINE StomateLpj_main (kjpindex, dt_days, EndOfYear, EndOfMonth, &
---
>   SUBROUTINE StomateLpj (npts, dt_days, EndOfYear, EndOfMonth, &
87c72
<        clayfraction, herbivores, &
---
>        clay, herbivores, &
105c90
<        co2_to_bm_dgvm, co2_fire, resp_hetero, resp_maint, resp_growth, &
---
>        co2_to_bm, co2_fire, resp_hetero, resp_maint, resp_growth, &
119c104
<     INTEGER(i_std), INTENT(in)                                           :: kjpindex
---
>     INTEGER(i_std), INTENT(in)                                           :: npts
123c108
<     INTEGER(i_std), DIMENSION(kjpindex,8), INTENT(in)                 :: neighbours
---
>     INTEGER(i_std), DIMENSION(npts,8), INTENT(in)                 :: neighbours
125c110
<     REAL(r_std), DIMENSION(kjpindex,2), INTENT(in)                     :: resolution
---
>     REAL(r_std), DIMENSION(npts,2), INTENT(in)                     :: resolution
127c112
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                       :: clayfraction
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                       :: clay
129c114
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)                  :: herbivores
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)                  :: herbivores
131c116
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                       :: tsurf_daily
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                       :: tsurf_daily
133c118
<     REAL(r_std), DIMENSION(kjpindex,nbdl), INTENT(in)                  :: tsoil_daily
---
>     REAL(r_std), DIMENSION(npts,nbdl), INTENT(in)                  :: tsoil_daily
135c120
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                       :: t2m_daily
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                       :: t2m_daily
137c122
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                       :: t2m_min_daily
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                       :: t2m_min_daily
139c124
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                       :: litterhum_daily
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                       :: litterhum_daily
141c126
<     REAL(r_std), DIMENSION(kjpindex,nbdl), INTENT(in)                  :: soilhum_daily
---
>     REAL(r_std), DIMENSION(npts,nbdl), INTENT(in)                  :: soilhum_daily
143c128
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)                  :: maxmoiavail_lastyear
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)                  :: maxmoiavail_lastyear
145c130
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)                  :: minmoiavail_lastyear
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)                  :: minmoiavail_lastyear
147c132
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                       :: gdd0_lastyear
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                       :: gdd0_lastyear
149c134
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                       :: precip_lastyear
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                       :: precip_lastyear
151c136
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)                  :: moiavail_month
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)                  :: moiavail_month
153c138
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)                  :: moiavail_week
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)                  :: moiavail_week
155c140
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                       :: tlong_ref
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                       :: tlong_ref
157c142
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                       :: t2m_month
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                       :: t2m_month
159c144
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                       :: t2m_week
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                       :: t2m_week
161c146
<     REAL(r_std), DIMENSION(kjpindex,nbdl), INTENT(in)                  :: tsoil_month
---
>     REAL(r_std), DIMENSION(npts,nbdl), INTENT(in)                  :: tsoil_month
163c148
<     REAL(r_std), DIMENSION(kjpindex,nbdl), INTENT(in)                  :: soilhum_month
---
>     REAL(r_std), DIMENSION(npts,nbdl), INTENT(in)                  :: soilhum_month
165c150
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)                   :: gdd_m5_dormance
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)                   :: gdd_m5_dormance
167c152
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)                   :: gdd_midwinter
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)                   :: gdd_midwinter
169c154
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)                  :: ncd_dormance
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)                  :: ncd_dormance
171c156
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)                  :: ngd_minus5
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)                  :: ngd_minus5
173c158
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts), INTENT(in)           :: turnover_longterm
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(in)           :: turnover_longterm
175c160
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)                  :: gpp_daily
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)                  :: gpp_daily
177c162
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)                  :: time_lowgpp
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)                  :: time_lowgpp
179c164
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)                  :: time_hum_min
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)                  :: time_hum_min
181c166
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)                  :: maxfpc_lastyear
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)                  :: maxfpc_lastyear
183c168
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts), INTENT(in)             :: resp_maint_part
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(in)             :: resp_maint_part
185c170
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)                  :: fpc_max
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)                  :: fpc_max
190c175
<     LOGICAL, DIMENSION(kjpindex,nvm), INTENT(inout)                  :: PFTpresent
---
>     LOGICAL, DIMENSION(npts,nvm), INTENT(inout)                  :: PFTpresent
192c177
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)               :: age
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)               :: age
194c179
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)          :: fireindex
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)          :: fireindex
196c181
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)          :: firelitter
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)          :: firelitter
198c183
<     REAL(r_std), DIMENSION(kjpindex,nvm,nleafages), INTENT(inout)     :: leaf_age
---
>     REAL(r_std), DIMENSION(npts,nvm,nleafages), INTENT(inout)     :: leaf_age
200c185
<     REAL(r_std), DIMENSION(kjpindex,nvm,nleafages), INTENT(inout)     :: leaf_frac
---
>     REAL(r_std), DIMENSION(npts,nvm,nleafages), INTENT(inout)     :: leaf_frac
202c187
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts), INTENT(inout)        :: biomass
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(inout)        :: biomass
204c189
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)               :: ind
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)               :: ind
206c191
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)               :: adapted
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)               :: adapted
208c193
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)               :: regenerate
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)               :: regenerate
210c195
<     LOGICAL, DIMENSION(kjpindex,nvm), INTENT(inout)                  :: senescence
---
>     LOGICAL, DIMENSION(npts,nvm), INTENT(inout)                  :: senescence
212c197
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)               :: when_growthinit
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)               :: when_growthinit
214c199
<     REAL(r_std), DIMENSION(kjpindex,nvm,nlitt), INTENT(inout)         :: litterpart
---
>     REAL(r_std), DIMENSION(npts,nvm,nlitt), INTENT(inout)         :: litterpart
216c201
<     REAL(r_std), DIMENSION(kjpindex,nlitt,nvm,nlevs), INTENT(inout)  :: litter
---
>     REAL(r_std), DIMENSION(npts,nlitt,nvm,nlevs), INTENT(inout)  :: litter
219c204
<     REAL(r_std), DIMENSION(kjpindex,nvm,nlitt), INTENT(inout)         :: dead_leaves
---
>     REAL(r_std), DIMENSION(npts,nvm,nlitt), INTENT(inout)         :: dead_leaves
221c206
<     REAL(r_std), DIMENSION(kjpindex,ncarb,nvm), INTENT(inout)    :: carbon
---
>     REAL(r_std), DIMENSION(npts,ncarb,nvm), INTENT(inout)    :: carbon
223c208
<     REAL(r_std), DIMENSION(kjpindex), INTENT(inout)                    :: black_carbon
---
>     REAL(r_std), DIMENSION(npts), INTENT(inout)                    :: black_carbon
226c211
<     REAL(r_std), DIMENSION(kjpindex,nvm,nlevs), INTENT(inout)    :: lignin_struc
---
>     REAL(r_std), DIMENSION(npts,nvm,nlevs), INTENT(inout)    :: lignin_struc
228c213
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)               :: veget_max
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)               :: veget_max
230c215
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)               :: veget
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)               :: veget
232c217
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)               :: npp_longterm
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)               :: npp_longterm
234c219
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)               :: lm_lastyearmax
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)               :: lm_lastyearmax
236c221
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)               :: veget_lastlight
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)               :: veget_lastlight
238c223
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)               :: everywhere
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)               :: everywhere
241c226
<     LOGICAL, DIMENSION(kjpindex,nvm), INTENT(inout)                  :: need_adjacent
---
>     LOGICAL, DIMENSION(npts,nvm), INTENT(inout)                  :: need_adjacent
243c228
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)               :: RIP_time
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)               :: RIP_time
245c230
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)          :: turnover_time
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)          :: turnover_time
250c235
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)                 :: lai
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)                 :: lai
254c239
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)                 :: rprof
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)                 :: rprof
256c241
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(out)                 :: npp_daily
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(out)                 :: npp_daily
258c243
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts), INTENT(out)          :: turnover_daily
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(out)          :: turnover_daily
260c245
<     REAL(r_std), DIMENSION(kjpindex,nlevs), INTENT(inout)                :: control_moist
---
>     REAL(r_std), DIMENSION(npts,nlevs), INTENT(inout)                :: control_moist
262c247
<     REAL(r_std), DIMENSION(kjpindex,nlevs), INTENT(inout)                :: control_temp
---
>     REAL(r_std), DIMENSION(npts,nlevs), INTENT(inout)                :: control_temp
265c250
<     REAL(r_std), DIMENSION(kjpindex,ncarb,nvm), INTENT(inout)      :: soilcarbon_input
---
>     REAL(r_std), DIMENSION(npts,ncarb,nvm), INTENT(inout)      :: soilcarbon_input
267c252,253
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(out)                      :: co2_to_bm_dgvm
---
>     !NV devient 2D
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(out)                      :: co2_to_bm
271c257
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(out)                      :: co2_fire
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(out)                      :: co2_fire
273c259
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)            :: resp_hetero
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)            :: resp_hetero
275c261
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(out)                 :: resp_maint
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(out)                 :: resp_maint
277c263
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(out)                 :: resp_growth
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(out)                 :: resp_growth
279c265
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)                 :: height
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)                 :: height
281c267
<     REAL(r_std), DIMENSION(kjpindex), INTENT(inout)                      :: deadleaf_cover
---
>     REAL(r_std), DIMENSION(npts), INTENT(inout)                      :: deadleaf_cover
283c269
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(out)                 :: vcmax
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(out)                 :: vcmax
285c271
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(out)                 :: vjmax
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(out)                 :: vjmax
287c273
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(out)                 :: t_photo_min
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(out)                 :: t_photo_min
289c275
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(out)                 :: t_photo_opt
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(out)                 :: t_photo_opt
291c277
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(out)                 :: t_photo_max
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(out)                 :: t_photo_max
293c279
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts), INTENT(out)          :: bm_to_litter
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(out)          :: bm_to_litter
296c282
<     REAL(r_std), DIMENSION(kjpindex,nvm),INTENT(inout)                 :: veget_max_new 
---
>     REAL(r_std), DIMENSION(npts,nvm),INTENT(inout)                 :: veget_max_new 
300,301c286,287
<     REAL(r_std),DIMENSION(kjpindex,0:10), INTENT(inout)                        :: prod10
<     REAL(r_std),DIMENSION(kjpindex,0:100), INTENT(inout)                       :: prod100
---
>     REAL(r_std),DIMENSION(npts,0:10), INTENT(inout)                        :: prod10
>     REAL(r_std),DIMENSION(npts,0:100), INTENT(inout)                       :: prod100
303,304c289,290
<     REAL(r_std),DIMENSION(kjpindex,10), INTENT(inout)                       :: flux10
<     REAL(r_std),DIMENSION(kjpindex,100), INTENT(inout)                      :: flux100
---
>     REAL(r_std),DIMENSION(npts,10), INTENT(inout)                       :: flux10
>     REAL(r_std),DIMENSION(npts,100), INTENT(inout)                      :: flux100
306c292
<     REAL(r_std),DIMENSION(kjpindex), INTENT(inout)                          :: convflux
---
>     REAL(r_std),DIMENSION(npts), INTENT(inout)                          :: convflux
308c294
<     REAL(r_std),DIMENSION(kjpindex), INTENT(inout)                          :: cflux_prod10, cflux_prod100
---
>     REAL(r_std),DIMENSION(npts), INTENT(inout)                          :: cflux_prod10, cflux_prod100
310c296
<     REAL(r_std), DIMENSION(kjpindex), INTENT(inout)                       :: harvest_above
---
>     REAL(r_std), DIMENSION(npts), INTENT(inout)                       :: harvest_above
312c298
<     REAL(r_std), DIMENSION(kjpindex), INTENT(inout)                       :: carb_mass_total
---
>     REAL(r_std), DIMENSION(npts), INTENT(inout)                       :: carb_mass_total
327c313
<     REAL(r_std), DIMENSION(kjpindex,nvm)                                   :: tot_bm_to_litter
---
>     REAL(r_std), DIMENSION(npts,nvm)                                   :: tot_bm_to_litter
329c315
<     REAL(r_std), DIMENSION(kjpindex,nvm)                                   :: tot_live_biomass
---
>     REAL(r_std), DIMENSION(npts,nvm)                                   :: tot_live_biomass
331c317
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts)                            :: bm_alloc
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts)                            :: bm_alloc
333c319
<     REAL(r_std), DIMENSION(kjpindex,nvm)                                   :: tot_turnover
---
>     REAL(r_std), DIMENSION(npts,nvm)                                   :: tot_turnover
335c321
<     REAL(r_std), DIMENSION(kjpindex,nvm)                                   :: tot_litter_soil_carb
---
>     REAL(r_std), DIMENSION(npts,nvm)                                   :: tot_litter_soil_carb
337c323
<     REAL(r_std), DIMENSION(kjpindex,nvm)                                   :: tot_litter_carb
---
>     REAL(r_std), DIMENSION(npts,nvm)                                   :: tot_litter_carb
339c325
<     REAL(r_std), DIMENSION(kjpindex,nvm)                                   :: tot_soil_carb
---
>     REAL(r_std), DIMENSION(npts,nvm)                                   :: tot_soil_carb
341c327,331
<     REAL(r_std), DIMENSION(kjpindex)                                      :: carb_mass_variation
---
>     REAL(r_std), DIMENSION(npts)                                      :: carb_mass_variation
>     ! crown area of individuals (m**2)
>     REAL(r_std), DIMENSION(npts,nvm)                               :: cn_ind
>     ! woodmass of individuals (gC)
>     REAL(r_std), DIMENSION(npts,nvm)                               :: woodmass_ind
343c333
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts)                        :: f_alloc
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts)                        :: f_alloc
345c335
<     REAL(r_std), DIMENSION(kjpindex)                                   :: avail_tree
---
>     REAL(r_std), DIMENSION(npts)                                   :: avail_tree
347c337
<     REAL(r_std), DIMENSION(kjpindex)                                   :: avail_grass
---
>     REAL(r_std), DIMENSION(npts)                                   :: avail_grass
352c342
<     REAL(r_std),DIMENSION(kjpindex)                                   :: prod10_total, prod100_total 
---
>     REAL(r_std),DIMENSION(npts)                                   :: prod10_total, prod100_total 
354c344,347
<     REAL(r_std),DIMENSION(kjpindex)                                       :: cflux_prod_total
---
>     REAL(r_std),DIMENSION(npts)                                       :: cflux_prod_total
> 
>     ! "maximal" coverage fraction of a PFT (LAI -> infinity) on ground
>     REAL(r_std),DIMENSION(npts,nvm)                                :: veget_max_old
357c350
<     REAL(r_std), DIMENSION(kjpindex,nvm)                               :: mortality
---
>     REAL(r_std), DIMENSION(npts,nvm)                               :: mortality
359c352
<     REAL(r_std), DIMENSION(kjpindex)                                   :: vartmp
---
>     REAL(r_std), DIMENSION(npts)                                   :: vartmp
361c354
<     REAL(r_std), DIMENSION(kjpindex,nvm)                          :: histvar
---
>     REAL(r_std), DIMENSION(npts,nvm)                          :: histvar
367,494d359
<     IF ( firstcall_lpj ) THEN
< !.OR. .NOT. firstcall_lpj  ????
<        !
<        ! 0 Allocation
<        !
< 
< 
<        ALLOCATE(cn_ind(kjpindex,nvm))
<        ALLOCATE(woodmass_ind(kjpindex,nvm))
<        ALLOCATE(veget_max_old(kjpindex,nvm))
< 
< !!$       IF ( control%ok_dgvm .OR. .NOT.lpj_gap_const_mort) THEN
< !!$
< !!$          CALL crown (kjpindex,  PFTpresent, &
< !!$               ind, biomass, woodmass_ind, &
< !!$               veget_max, cn_ind, height)
< !!$
< !!$       ENDIF
< !!$
< !!$       CALL prescribe (kjpindex, &
< !!$            veget_max, PFTpresent, everywhere, when_growthinit, &
< !!$            biomass, leaf_frac, ind, cn_ind)
< !!$       
<        CALL constraints_main (kjpindex, dt_days, &
<             t2m_month, t2m_min_daily,when_growthinit, &
<             adapted, regenerate)
< 
<        IF ( control%ok_dgvm ) THEN
< 
<           CALL pftinout_main (kjpindex, dt_days, adapted, regenerate, &
<                neighbours, veget, veget_max, &
<                biomass, ind, cn_ind, age, leaf_frac, npp_longterm, lm_lastyearmax, senescence, &
<                PFTpresent, everywhere, when_growthinit, need_adjacent, RIP_time, &
<                co2_to_bm_dgvm, &
<                avail_tree, avail_grass)
< 
< !!$          CALL kill (kjpindex, 'pftinout  ', lm_lastyearmax, &
< !!$               ind, PFTpresent, cn_ind, biomass, senescence, RIP_time, &
< !!$               lai, age, leaf_age, leaf_frac, npp_longterm, &
< !!$               when_growthinit, everywhere, veget, veget_max, bm_to_litter)
< !!$
<        ENDIF
< 
<        CALL phenology_main (kjpindex, dt_days, PFTpresent, &
<             veget_max, &
<             tlong_ref, t2m_month, t2m_week, gpp_daily, &
<             maxmoiavail_lastyear, minmoiavail_lastyear, &
<             moiavail_month, moiavail_week, &
<             gdd_m5_dormance, gdd_midwinter, ncd_dormance, ngd_minus5, &
<             senescence, time_lowgpp, time_hum_min, &
<             biomass, leaf_frac, leaf_age, &
<             when_growthinit, co2_to_bm_dgvm, lai)
< 
<        CALL alloc_main (kjpindex, dt_days, &
<             lai, veget_max, senescence, when_growthinit, &
<             moiavail_week, tsoil_month, soilhum_month, &
<             biomass, age, leaf_age, leaf_frac, rprof, f_alloc)
< 
<        CALL npp_calc_main (kjpindex, dt_days, &
<             PFTpresent, &
<             tlong_ref, t2m_daily, tsoil_daily, lai, rprof, &
<             gpp_daily, f_alloc, bm_alloc, resp_maint_part,&
<             biomass, leaf_age, leaf_frac, age, &
<             resp_maint, resp_growth, npp_daily)
< 
<        CALL fire_main (kjpindex, dt_days, litterpart, &
<             litterhum_daily, t2m_daily, lignin_struc, &
<             fireindex, firelitter, biomass, ind, &
<             litter, dead_leaves, bm_to_litter, black_carbon, &
<             co2_fire)
<        
<        CALL gap_main (kjpindex, dt_days, &
<             npp_longterm, turnover_longterm, lm_lastyearmax, &
<             PFTpresent, biomass, ind, bm_to_litter, mortality)
< 
< 
<        CALL vmax (kjpindex, dt_days, &
<             leaf_age, leaf_frac, &
<             vcmax, vjmax)
< 
< !!$       CALL assim_temp (kjpindex, tlong_ref, t2m_month, &
< !!$            t_photo_min, t_photo_opt, t_photo_max)
< !!$
<        CALL turn_main (kjpindex, dt_days, PFTpresent, &
<             herbivores, &
<             maxmoiavail_lastyear, minmoiavail_lastyear, &
<             moiavail_week,  moiavail_month,tlong_ref, t2m_month, t2m_week, veget_max, &
<             leaf_age, leaf_frac, age, lai, biomass, &
<             turnover_daily, senescence,turnover_time)
< 
<        IF ( control%ok_dgvm ) THEN
< 
<           CALL light_main (kjpindex, dt_days, &
<                veget_max, fpc_max, PFTpresent, cn_ind, lai, maxfpc_lastyear, &
<                lm_lastyearmax, ind, biomass, veget_lastlight, bm_to_litter, mortality)
<           
<        ENDIF
<        
<        IF ( control%ok_dgvm .OR. .NOT.lpj_gap_const_mort ) THEN
< 
<           CALL establish_main (kjpindex, dt_days, PFTpresent, regenerate, &
<                neighbours, resolution, need_adjacent, herbivores, &
<                precip_lastyear, gdd0_lastyear, lm_lastyearmax, &
<                cn_ind, lai, avail_tree, avail_grass, npp_longterm, &
<                leaf_age, leaf_frac, &
<                ind, biomass, age, everywhere, co2_to_bm_dgvm, veget_max, woodmass_ind)
< 
<        ENDIF
< 
< !!$       CALL cover (kjpindex, cn_ind, ind, biomass, &
< !!$            veget_max, veget_max_old, veget, &
< !!$            lai, litter, carbon, turnover_daily, bm_to_litter)
< !!$       
< !!$       IF (lcchange) THEN
< !!$          CALL lcchange_main (kjpindex, dt_days, veget_max, veget_max_new, &
< !!$               biomass, ind, age, PFTpresent, senescence, when_growthinit, &
< !!$               everywhere, veget, & 
< !!$               co2_to_bm_dgvm, bm_to_litter, turnover_daily, cn_ind,flux10,flux100, &
< !!$               prod10,prod100,convflux,cflux_prod10,cflux_prod100,leaf_frac,&
< !!$               npp_longterm, lm_lastyearmax, litter, carbon)
< !!$       ENDIF
< 
< 
<        firstcall_lpj=.FALSE.
<        RETURN
< 
<     ENDIF
< 
502c367
<     co2_to_bm_dgvm(:,:) = zero
---
>     co2_to_bm(:,:) = zero
541c406
<        CALL crown (kjpindex,  PFTpresent, &
---
>        CALL crown (npts,  PFTpresent, &
555c420
<     CALL prescribe (kjpindex, &
---
>     CALL prescribe (npts, &
565c430
<     CALL constraints_main (kjpindex, dt_days, &
---
>     CALL constraints (npts, dt_days, &
579c444
<        CALL pftinout_main (kjpindex, dt_days, adapted, regenerate, &
---
>        CALL pftinout (npts, dt_days, adapted, regenerate, &
583c448
<             co2_to_bm_dgvm, &
---
>             co2_to_bm, &
592c457
<        CALL kill (kjpindex, 'pftinout  ', lm_lastyearmax, &
---
>        CALL kill (npts, 'pftinout  ', lm_lastyearmax, &
618c483
<        CALL crown (kjpindex, PFTpresent, &
---
>        CALL crown (npts, PFTpresent, &
627,628c492,493
<     CALL histwrite (hist_id_stomate, 'WHEN_GROWTHINIT', itime, when_growthinit, kjpindex*nvm, horipft_index)
<     CALL histwrite (hist_id_stomate, 'TIME_LOWGPP', itime, time_lowgpp, kjpindex*nvm, horipft_index)
---
>     CALL histwrite (hist_id_stomate, 'WHEN_GROWTHINIT', itime, when_growthinit, npts*nvm, horipft_index)
>     CALL histwrite (hist_id_stomate, 'TIME_LOWGPP', itime, time_lowgpp, npts*nvm, horipft_index)
635c500
<     CALL histwrite (hist_id_stomate, 'PFTPRESENT', itime, histvar, kjpindex*nvm, horipft_index)
---
>     CALL histwrite (hist_id_stomate, 'PFTPRESENT', itime, histvar, npts*nvm, horipft_index)
642c507
<     CALL histwrite (hist_id_stomate, 'GDD_MIDWINTER', itime, histvar, kjpindex*nvm, horipft_index)
---
>     CALL histwrite (hist_id_stomate, 'GDD_MIDWINTER', itime, histvar, npts*nvm, horipft_index)
649c514
<     CALL histwrite (hist_id_stomate, 'NCD_DORMANCE', itime, histvar, kjpindex*nvm, horipft_index)
---
>     CALL histwrite (hist_id_stomate, 'NCD_DORMANCE', itime, histvar, npts*nvm, horipft_index)
651c516
<     CALL phenology_main (kjpindex, dt_days, PFTpresent, &
---
>     CALL phenology (npts, dt_days, PFTpresent, &
659c524
<          when_growthinit, co2_to_bm_dgvm, lai)
---
>          when_growthinit, co2_to_bm, lai)
665c530
<     CALL alloc_main (kjpindex, dt_days, &
---
>     CALL alloc (npts, dt_days, &
674c539
<     CALL npp_calc_main (kjpindex, dt_days, &
---
>     CALL npp_calc (npts, dt_days, &
682c547
<        CALL kill (kjpindex, 'npp       ', lm_lastyearmax,  &
---
>        CALL kill (npts, 'npp       ', lm_lastyearmax,  &
703c568
<        CALL crown (kjpindex, PFTpresent, &
---
>        CALL crown (npts, PFTpresent, &
713c578
<     CALL fire_main (kjpindex, dt_days, litterpart, &
---
>     CALL fire (npts, dt_days, litterpart, &
723c588
<        CALL kill (kjpindex, 'fire      ', lm_lastyearmax, &
---
>        CALL kill (npts, 'fire      ', lm_lastyearmax, &
734c599
<     CALL gap_main (kjpindex, dt_days, &
---
>     CALL gap (npts, dt_days, &
742c607
<        CALL kill (kjpindex, 'gap       ', lm_lastyearmax, &
---
>        CALL kill (npts, 'gap       ', lm_lastyearmax, &
753c618
<     CALL vmax (kjpindex, dt_days, &
---
>     CALL vmax (npts, dt_days, &
757c622
<     CALL assim_temp (kjpindex, tlong_ref, t2m_month, &
---
>     CALL assim_temp (npts, tlong_ref, t2m_month, &
764c629
<     CALL turn_main (kjpindex, dt_days, PFTpresent, &
---
>     CALL turn (npts, dt_days, PFTpresent, &
781c646
<        CALL light_main (kjpindex, dt_days, &
---
>        CALL light (npts, dt_days, &
789c654
<        CALL kill (kjpindex, 'light     ', lm_lastyearmax, &
---
>        CALL kill (npts, 'light     ', lm_lastyearmax, &
806c671
<        CALL establish_main (kjpindex, dt_days, PFTpresent, regenerate, &
---
>        CALL establish (npts, dt_days, PFTpresent, regenerate, &
811c676
<             ind, biomass, age, everywhere, co2_to_bm_dgvm, veget_max, woodmass_ind)
---
>             ind, biomass, age, everywhere, co2_to_bm, veget_max, woodmass_ind)
817c682
<        CALL crown (kjpindex, PFTpresent, &
---
>        CALL crown (npts, PFTpresent, &
827c692
<     CALL cover (kjpindex, cn_ind, ind, biomass, &
---
>     CALL cover (npts, cn_ind, ind, biomass, &
839c704
<        CALL harvest(kjpindex, dt_days, veget_max, veget, &
---
>        CALL harvest(npts, dt_days, veget_max, veget, &
849c714
<           CALL lcchange_main (kjpindex, dt_days, veget_max, veget_max_new, &
---
>           CALL lcchange_main (npts, dt_days, veget_max, veget_max_new, &
852c717
<                co2_to_bm_dgvm, bm_to_litter, turnover_daily, cn_ind,flux10,flux100, &
---
>                co2_to_bm, bm_to_litter, turnover_daily, bm_sapl, tree, cn_ind,flux10,flux100, &
906c771
<          resolution(:,1), kjpindex, hori_index)
---
>          resolution(:,1), npts, hori_index)
908c773
<          resolution(:,2), kjpindex, hori_index)
---
>          resolution(:,2), npts, hori_index)
910c775
<          contfrac(:), kjpindex, hori_index)
---
>          contfrac(:), npts, hori_index)
913c778
<          litter(:,istructural,:,iabove), kjpindex*nvm, horipft_index)
---
>          litter(:,istructural,:,iabove), npts*nvm, horipft_index)
915c780
<          litter(:,imetabolic,:,iabove), kjpindex*nvm, horipft_index)
---
>          litter(:,imetabolic,:,iabove), npts*nvm, horipft_index)
917c782
<          litter(:,istructural,:,ibelow), kjpindex*nvm, horipft_index)
---
>          litter(:,istructural,:,ibelow), npts*nvm, horipft_index)
919c784
<          litter(:,imetabolic,:,ibelow), kjpindex*nvm, horipft_index)
---
>          litter(:,imetabolic,:,ibelow), npts*nvm, horipft_index)
922c787
<          deadleaf_cover, kjpindex, hori_index)
---
>          deadleaf_cover, npts, hori_index)
925c790
<          tot_litter_soil_carb, kjpindex*nvm, horipft_index)
---
>          tot_litter_soil_carb, npts*nvm, horipft_index)
927c792
<          carbon(:,iactive,:), kjpindex*nvm, horipft_index)
---
>          carbon(:,iactive,:), npts*nvm, horipft_index)
929c794
<          carbon(:,islow,:), kjpindex*nvm, horipft_index)
---
>          carbon(:,islow,:), npts*nvm, horipft_index)
931c796
<          carbon(:,ipassive,:), kjpindex*nvm, horipft_index)
---
>          carbon(:,ipassive,:), npts*nvm, horipft_index)
934c799
<          t2m_month, kjpindex, hori_index)
---
>          t2m_month, npts, hori_index)
936c801
<          t2m_week, kjpindex, hori_index)
---
>          t2m_week, npts, hori_index)
939c804
<          resp_hetero(:,:), kjpindex*nvm, horipft_index)
---
>          resp_hetero(:,:), npts*nvm, horipft_index)
942c807
<          black_carbon, kjpindex, hori_index)
---
>          black_carbon, npts, hori_index)
945c810
<          fireindex(:,:), kjpindex*nvm, horipft_index)
---
>          fireindex(:,:), npts*nvm, horipft_index)
947c812
<          litterhum_daily, kjpindex, hori_index)
---
>          litterhum_daily, npts, hori_index)
949c814
<          co2_fire, kjpindex*nvm, horipft_index)
---
>          co2_fire, npts*nvm, horipft_index)
951c816
<          co2_to_bm_dgvm, kjpindex*nvm, horipft_index)
---
>          co2_to_bm, npts*nvm, horipft_index)
954c819
<          convflux, kjpindex, hori_index)
---
>          convflux, npts, hori_index)
956c821
<          cflux_prod10, kjpindex, hori_index)
---
>          cflux_prod10, npts, hori_index)
958c823
<          cflux_prod100, kjpindex, hori_index)
---
>          cflux_prod100, npts, hori_index)
960c825
<          harvest_above, kjpindex, hori_index)
---
>          harvest_above, npts, hori_index)
965c830
<          lai, kjpindex*nvm, horipft_index)
---
>          lai, npts*nvm, horipft_index)
967c832
<          veget, kjpindex*nvm, horipft_index)
---
>          veget, npts*nvm, horipft_index)
969c834
<          veget_max, kjpindex*nvm, horipft_index)
---
>          veget_max, npts*nvm, horipft_index)
971c836
<          npp_daily, kjpindex*nvm, horipft_index)
---
>          npp_daily, npts*nvm, horipft_index)
973c838
<          gpp_daily, kjpindex*nvm, horipft_index)
---
>          gpp_daily, npts*nvm, horipft_index)
975c840
<          ind, kjpindex*nvm, horipft_index)
---
>          ind, npts*nvm, horipft_index)
977c842
<          cn_ind, kjpindex*nvm, horipft_index)
---
>          cn_ind, npts*nvm, horipft_index)
979c844
<          woodmass_ind, kjpindex*nvm, horipft_index)
---
>          woodmass_ind, npts*nvm, horipft_index)
981c846
<          tot_live_biomass, kjpindex*nvm, horipft_index)
---
>          tot_live_biomass, npts*nvm, horipft_index)
983c848
<          biomass(:,:,ileaf), kjpindex*nvm, horipft_index)
---
>          biomass(:,:,ileaf), npts*nvm, horipft_index)
985c850
<          biomass(:,:,isapabove), kjpindex*nvm, horipft_index)
---
>          biomass(:,:,isapabove), npts*nvm, horipft_index)
987c852
<          biomass(:,:,isapbelow), kjpindex*nvm, horipft_index)
---
>          biomass(:,:,isapbelow), npts*nvm, horipft_index)
989c854
<          biomass(:,:,iheartabove), kjpindex*nvm, horipft_index)
---
>          biomass(:,:,iheartabove), npts*nvm, horipft_index)
991c856
<          biomass(:,:,iheartbelow), kjpindex*nvm, horipft_index)
---
>          biomass(:,:,iheartbelow), npts*nvm, horipft_index)
993c858
<          biomass(:,:,iroot), kjpindex*nvm, horipft_index)
---
>          biomass(:,:,iroot), npts*nvm, horipft_index)
995c860
<          biomass(:,:,ifruit), kjpindex*nvm, horipft_index)
---
>          biomass(:,:,ifruit), npts*nvm, horipft_index)
997c862
<          biomass(:,:,icarbres), kjpindex*nvm, horipft_index)
---
>          biomass(:,:,icarbres), npts*nvm, horipft_index)
999c864
<          tot_turnover, kjpindex*nvm, horipft_index)
---
>          tot_turnover, npts*nvm, horipft_index)
1001c866
<          turnover_daily(:,:,ileaf), kjpindex*nvm, horipft_index)
---
>          turnover_daily(:,:,ileaf), npts*nvm, horipft_index)
1003c868
<          turnover_daily(:,:,isapabove), kjpindex*nvm, horipft_index)
---
>          turnover_daily(:,:,isapabove), npts*nvm, horipft_index)
1005c870
<          turnover_daily(:,:,iroot), kjpindex*nvm, horipft_index)
---
>          turnover_daily(:,:,iroot), npts*nvm, horipft_index)
1007c872
<          turnover_daily(:,:,ifruit), kjpindex*nvm, horipft_index)
---
>          turnover_daily(:,:,ifruit), npts*nvm, horipft_index)
1009c874
<          tot_bm_to_litter, kjpindex*nvm, horipft_index)
---
>          tot_bm_to_litter, npts*nvm, horipft_index)
1011c876
<          bm_to_litter(:,:,ileaf), kjpindex*nvm, horipft_index)
---
>          bm_to_litter(:,:,ileaf), npts*nvm, horipft_index)
1013c878
<          bm_to_litter(:,:,isapabove), kjpindex*nvm, horipft_index)
---
>          bm_to_litter(:,:,isapabove), npts*nvm, horipft_index)
1015c880
<          bm_to_litter(:,:,isapbelow), kjpindex*nvm, horipft_index)
---
>          bm_to_litter(:,:,isapbelow), npts*nvm, horipft_index)
1017c882
<          bm_to_litter(:,:,iheartabove), kjpindex*nvm, horipft_index)
---
>          bm_to_litter(:,:,iheartabove), npts*nvm, horipft_index)
1019c884
<          bm_to_litter(:,:,iheartbelow), kjpindex*nvm, horipft_index)
---
>          bm_to_litter(:,:,iheartbelow), npts*nvm, horipft_index)
1021c886
<          bm_to_litter(:,:,iroot), kjpindex*nvm, horipft_index)
---
>          bm_to_litter(:,:,iroot), npts*nvm, horipft_index)
1023c888
<          bm_to_litter(:,:,ifruit), kjpindex*nvm, horipft_index)
---
>          bm_to_litter(:,:,ifruit), npts*nvm, horipft_index)
1025c890
<          bm_to_litter(:,:,icarbres), kjpindex*nvm, horipft_index)
---
>          bm_to_litter(:,:,icarbres), npts*nvm, horipft_index)
1027c892
<          resp_maint, kjpindex*nvm, horipft_index)
---
>          resp_maint, npts*nvm, horipft_index)
1029c894
<          resp_growth, kjpindex*nvm, horipft_index)
---
>          resp_growth, npts*nvm, horipft_index)
1031c896
<          age, kjpindex*nvm, horipft_index)
---
>          age, npts*nvm, horipft_index)
1033c898
<          height, kjpindex*nvm, horipft_index)
---
>          height, npts*nvm, horipft_index)
1035c900
<          moiavail_week, kjpindex*nvm, horipft_index)
---
>          moiavail_week, npts*nvm, horipft_index)
1037c902
<          vcmax, kjpindex*nvm, horipft_index)
---
>          vcmax, npts*nvm, horipft_index)
1039c904
<          turnover_time, kjpindex*nvm, horipft_index)
---
>          turnover_time, npts*nvm, horipft_index)
1042c907
<          prod10, kjpindex*11, horip11_index)
---
>          prod10, npts*11, horip11_index)
1044c909
<          prod100, kjpindex*101, horip101_index)
---
>          prod100, npts*101, horip101_index)
1046c911
<          flux10, kjpindex*10, horip10_index)
---
>          flux10, npts*10, horip10_index)
1048c913
<          flux100, kjpindex*100, horip100_index)
---
>          flux100, npts*100, horip100_index)
1053c918
<             vartmp, kjpindex, hori_index)
---
>             vartmp, npts, hori_index)
1056c921
<             vartmp, kjpindex, hori_index)
---
>             vartmp, npts, hori_index)
1059c924
<             vartmp, kjpindex, hori_index)
---
>             vartmp, npts, hori_index)
1062c927
<             vartmp, kjpindex, hori_index)
---
>             vartmp, npts, hori_index)
1065c930
<             vartmp, kjpindex, hori_index)
---
>             vartmp, npts, hori_index)
1069c934
<             vartmp, kjpindex, hori_index)
---
>             vartmp, npts, hori_index)
1072c937
<             vartmp, kjpindex, hori_index)
---
>             vartmp, npts, hori_index)
1075c940
<             vartmp, kjpindex, hori_index)
---
>             vartmp, npts, hori_index)
1078c943
<             vartmp, kjpindex, hori_index)
---
>             vartmp, npts, hori_index)
1081c946
<             vartmp, kjpindex, hori_index)
---
>             vartmp, npts, hori_index)
1084c949
<             vartmp, kjpindex, hori_index)
---
>             vartmp, npts, hori_index)
1087c952
<             vartmp, kjpindex, hori_index)
---
>             vartmp, npts, hori_index)
1090c955
<             vartmp, kjpindex, hori_index)
---
>             vartmp, npts, hori_index)
1094c959
<             vartmp, kjpindex, hori_index)
---
>             vartmp, npts, hori_index)
1097c962
<             vartmp, kjpindex, hori_index)
---
>             vartmp, npts, hori_index)
1100c965
<             vartmp, kjpindex, hori_index)
---
>             vartmp, npts, hori_index)
1103c968
<             vartmp, kjpindex, hori_index)
---
>             vartmp, npts, hori_index)
1106c971
<             vartmp, kjpindex, hori_index)
---
>             vartmp, npts, hori_index)
1110c975
<             vartmp, kjpindex, hori_index)
---
>             vartmp, npts, hori_index)
1113c978
<             vartmp, kjpindex, hori_index)
---
>             vartmp, npts, hori_index)
1116c981
<             vartmp, kjpindex, hori_index)
---
>             vartmp, npts, hori_index)
1119c984
<             vartmp, kjpindex, hori_index)
---
>             vartmp, npts, hori_index)
1122c987
<             vartmp, kjpindex, hori_index)
---
>             vartmp, npts, hori_index)
1125c990
<             vartmp, kjpindex, hori_index)
---
>             vartmp, npts, hori_index)
1128c993
<             vartmp, kjpindex, hori_index)
---
>             vartmp, npts, hori_index)
1133c998
<             histvar, kjpindex*nvm, horipft_index)
---
>             histvar, npts*nvm, horipft_index)
1136c1001
<             vartmp, kjpindex, hori_index)
---
>             vartmp, npts, hori_index)
1139c1004
<             vartmp, kjpindex, hori_index)
---
>             vartmp, npts, hori_index)
1142c1007
<             vartmp, kjpindex, hori_index)
---
>             vartmp, npts, hori_index)
1145c1010
<             vartmp, kjpindex, hori_index)
---
>             vartmp, npts, hori_index)
1148c1013
<             vartmp, kjpindex, hori_index)
---
>             vartmp, npts, hori_index)
1151c1016
<             vartmp, kjpindex, hori_index)
---
>             vartmp, npts, hori_index)
1154c1019
<             vartmp, kjpindex, hori_index)
---
>             vartmp, npts, hori_index)
1157c1022
<             vartmp, kjpindex, hori_index)
---
>             vartmp, npts, hori_index)
1160c1025
<             vartmp, kjpindex, hori_index)
---
>             vartmp, npts, hori_index)
1163c1028
<             resolution(:,1), kjpindex, hori_index)
---
>             resolution(:,1), npts, hori_index)
1165c1030
<             resolution(:,2), kjpindex, hori_index)
---
>             resolution(:,2), npts, hori_index)
1167c1032
<             contfrac(:), kjpindex, hori_index)
---
>             contfrac(:), npts, hori_index)
1173c1038
<   END SUBROUTINE StomateLpj_main
---
>   END SUBROUTINE StomateLpj
1175c1040
<   SUBROUTINE harvest(kjpindex, dt_days, veget_max, veget, &
---
>   SUBROUTINE harvest(npts, dt_days, veget_max, veget, &
1181c1046
<     INTEGER, INTENT(in)                                            :: kjpindex
---
>     INTEGER, INTENT(in)                                            :: npts
1187c1052
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)                 :: veget_max
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)                 :: veget_max
1192c1057
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)                    :: veget
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)                    :: veget
1195c1060
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts), INTENT(inout)           :: bm_to_litter
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(inout)           :: bm_to_litter
1198c1063
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts), INTENT(inout)          :: turnover_daily
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(inout)          :: turnover_daily
1200c1065
<     REAL(r_std), DIMENSION(kjpindex), INTENT(inout)                       :: harvest_above
---
>     REAL(r_std), DIMENSION(npts), INTENT(inout)                       :: harvest_above
1211c1076
<     DO i = 1, kjpindex
---
>     DO i = 1, npts
diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile /login/IPSL_CODE/AssimilBranche/modeles/ORCHIDEE/src_stomate/stomate_npp.f90 /login/IPSL_CODE/ORCHIDEE_1_9_5_2/modeles/ORCHIDEE/src_stomate/stomate_npp.f90
24c24
<   PUBLIC npp_calc_main,npp_calc_clear
---
>   PUBLIC npp_calc,npp_calc_clear
27c27
<   LOGICAL, SAVE                                              :: firstcall_npp = .TRUE.
---
>   LOGICAL, SAVE                                              :: firstcall = .TRUE.
30,31d29
< ! List of subroutines for initialization :
< !- npp_calc_clear
34c32
<     firstcall_npp=.TRUE.
---
>     firstcall=.TRUE.
37c35
<   SUBROUTINE npp_calc_main (kjpindex, dt_days, &
---
>   SUBROUTINE npp_calc (npts, dt, &
39c37
<        tlong_ref, t2m_daily, tsoil_daily, lai, rprof, &
---
>        tlong_ref, t2m, tsoil, lai, rprof, &
42c40
<        resp_maint, resp_growth, npp_daily)
---
>        resp_maint, resp_growth, npp)
51c49
<     INTEGER(i_std), INTENT(in)                                        :: kjpindex
---
>     INTEGER(i_std), INTENT(in)                                        :: npts
53c51
<     REAL(r_std), INTENT(in)                                     :: dt_days
---
>     REAL(r_std), INTENT(in)                                     :: dt
55c53
<     LOGICAL, DIMENSION(kjpindex,nvm), INTENT(in)                  :: PFTpresent
---
>     LOGICAL, DIMENSION(npts,nvm), INTENT(in)                  :: PFTpresent
57c55
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                    :: tlong_ref
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                    :: tlong_ref
59c57
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                    :: t2m_daily
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                    :: t2m
61c59
<     REAL(r_std), DIMENSION(kjpindex,nbdl), INTENT(in)               :: tsoil_daily
---
>     REAL(r_std), DIMENSION(npts,nbdl), INTENT(in)               :: tsoil
63c61
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)               :: lai
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)               :: lai
65c63
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)               :: rprof
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)               :: rprof
67c65
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)               :: gpp
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)               :: gpp
69c67
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts), INTENT(in)        :: f_alloc
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(in)        :: f_alloc
71c69
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts), INTENT(in)             :: resp_maint_part
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(in)             :: resp_maint_part
76c74
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts), INTENT(inout)     :: biomass
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(inout)     :: biomass
78c76
<     REAL(r_std), DIMENSION(kjpindex,nvm,nleafages), INTENT(inout)  :: leaf_age
---
>     REAL(r_std), DIMENSION(npts,nvm,nleafages), INTENT(inout)  :: leaf_age
80c78
<     REAL(r_std), DIMENSION(kjpindex,nvm,nleafages), INTENT(inout)  :: leaf_frac
---
>     REAL(r_std), DIMENSION(npts,nvm,nleafages), INTENT(inout)  :: leaf_frac
82c80
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)            :: age
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)            :: age
87c85
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(out)              :: resp_maint
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(out)              :: resp_maint
89c87
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(out)              :: resp_growth
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(out)              :: resp_growth
91c89
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(out)              :: npp_daily
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(out)              :: npp
93c91
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts), INTENT(out)       :: bm_alloc
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(out)       :: bm_alloc
98a97,98
>     ! soil levels (m)
>     REAL(r_std), SAVE, DIMENSION(0:nbdl)                        :: z_soil
100c100
<     REAL(r_std), DIMENSION(kjpindex,nvm)                           :: t_root
---
>     REAL(r_std), DIMENSION(npts,nvm)                           :: t_root
102c102
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts)                    :: coeff_maint
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts)                    :: coeff_maint
104c104
<     REAL(r_std), DIMENSION(kjpindex,nparts)                         :: t_maint
---
>     REAL(r_std), DIMENSION(npts,nparts)                         :: t_maint
106c106
<     REAL(r_std), DIMENSION(kjpindex)                                :: rpc
---
>     REAL(r_std), DIMENSION(npts)                                :: rpc
108c108
<     REAL(r_std), DIMENSION(kjpindex)                                :: tl
---
>     REAL(r_std), DIMENSION(npts)                                :: tl
110c110
<     REAL(r_std), DIMENSION(kjpindex)                                :: slope
---
>     REAL(r_std), DIMENSION(npts)                                :: slope
112c112
<     REAL(r_std), DIMENSION(kjpindex,nparts)                         :: resp_growth_part
---
>     REAL(r_std), DIMENSION(npts,nparts)                         :: resp_growth_part
114c114
<     REAL(r_std), DIMENSION(kjpindex,nvm)                           :: bm_alloc_tot
---
>     REAL(r_std), DIMENSION(npts,nvm)                           :: bm_alloc_tot
116c116
<     REAL(r_std), DIMENSION(kjpindex)                                :: bm_add
---
>     REAL(r_std), DIMENSION(npts)                                :: bm_add
118c118
<     REAL(r_std), DIMENSION(kjpindex)                                :: bm_new
---
>     REAL(r_std), DIMENSION(npts)                                :: bm_new
120c120
<     REAL(r_std), DIMENSION(kjpindex,nvm)                           :: leaf_mass_young
---
>     REAL(r_std), DIMENSION(npts,nvm)                           :: leaf_mass_young
122c122
<     REAL(r_std), DIMENSION(kjpindex,nvm)                           :: lm_old
---
>     REAL(r_std), DIMENSION(npts,nvm)                           :: lm_old
124c124
<     REAL(r_std), DIMENSION(kjpindex,nvm)                           :: bm_create
---
>     REAL(r_std), DIMENSION(npts,nvm)                           :: bm_create
126c126
<     REAL(r_std), DIMENSION(kjpindex)                                :: bm_tax_max
---
>     REAL(r_std), DIMENSION(npts)                                :: bm_tax_max
128c128
<     REAL(r_std), DIMENSION(kjpindex)                                :: bm_pump
---
>     REAL(r_std), DIMENSION(npts)                                :: bm_pump
143c143,148
<     IF ( firstcall_npp ) THEN
---
>     IF ( firstcall ) THEN
> 
>        ! 1.1.1 soil levels
> 
>        z_soil(0) = zero
>        z_soil(1:nbdl) = diaglev(1:nbdl)
152,153c157,158
<        firstcall_npp = .FALSE.
<        RETURN
---
>        firstcall = .FALSE.
> 
163c168
<     npp_daily(:,:) = zero
---
>     npp(:,:) = zero
182c187
<                t_root(:,j) + tsoil_daily(:,l) * rpc(:) * &
---
>                t_root(:,j) + tsoil(:,l) * rpc(:) * &
193c198
<     bm_alloc_tot(:,:) = gpp(:,:) * dt_days
---
>     bm_alloc_tot(:,:) = gpp(:,:) * dt
207,209c212,214
<        t_maint(:,ileaf) = t2m_daily(:)
<        t_maint(:,isapabove) = t2m_daily(:)
<        t_maint(:,ifruit) = t2m_daily(:)
---
>        t_maint(:,ileaf) = t2m(:)
>        t_maint(:,isapabove) = t2m(:)
>        t_maint(:,ifruit) = t2m(:)
219c224
<        t_maint(:,iheartabove) = t2m_daily(:)
---
>        t_maint(:,iheartabove) = t2m(:)
224c229
<           t_maint(:,icarbres) = t2m_daily(:)
---
>           t_maint(:,icarbres) = t2m(:)
284c289
<        DO i = 1, kjpindex
---
>        DO i = 1, npts
287c292
<                ( ( resp_maint(i,j) * dt_days ) .LT. bm_tax_max(i) ) ) THEN
---
>                ( ( resp_maint(i,j) * dt ) .LT. bm_tax_max(i) ) ) THEN
289c294
<              bm_alloc_tot(i,j) = bm_alloc_tot(i,j) - resp_maint(i,j) * dt_days
---
>              bm_alloc_tot(i,j) = bm_alloc_tot(i,j) - resp_maint(i,j) * dt
298c303
<              bm_pump(i) = resp_maint(i,j) * dt_days - bm_tax_max(i)
---
>              bm_pump(i) = resp_maint(i,j) * dt - bm_tax_max(i)
332c337
<        resp_growth_part(:,:) = frac_growthresp * bm_alloc(:,j,:) / dt_days
---
>        resp_growth_part(:,:) = frac_growthresp * bm_alloc(:,j,:) / dt
377c382
<              resp_maint(:,j) = resp_maint(:,j) - bm_create(:,j) / dt_days
---
>              resp_maint(:,j) = resp_maint(:,j) - bm_create(:,j) / dt
390c395
<        npp_daily(:,j) = gpp(:,j) - resp_growth(:,j) - resp_maint(:,j)
---
>        npp(:,j) = gpp(:,j) - resp_growth(:,j) - resp_maint(:,j)
455c460
<        age(:,:) = age(:,:) + dt_days/one_year
---
>        age(:,:) = age(:,:) + dt/one_year
498c503
<          bm_alloc(:,:,ileaf), kjpindex*nvm, horipft_index)
---
>          bm_alloc(:,:,ileaf), npts*nvm, horipft_index)
500c505
<          bm_alloc(:,:,isapabove), kjpindex*nvm, horipft_index)
---
>          bm_alloc(:,:,isapabove), npts*nvm, horipft_index)
502c507
<          bm_alloc(:,:,isapbelow), kjpindex*nvm, horipft_index)
---
>          bm_alloc(:,:,isapbelow), npts*nvm, horipft_index)
504c509
<          bm_alloc(:,:,iroot), kjpindex*nvm, horipft_index)
---
>          bm_alloc(:,:,iroot), npts*nvm, horipft_index)
506c511
<          bm_alloc(:,:,ifruit), kjpindex*nvm, horipft_index)
---
>          bm_alloc(:,:,ifruit), npts*nvm, horipft_index)
508c513
<          bm_alloc(:,:,icarbres), kjpindex*nvm, horipft_index)
---
>          bm_alloc(:,:,icarbres), npts*nvm, horipft_index)
512c517
<   END SUBROUTINE npp_calc_main
---
>   END SUBROUTINE npp_calc
diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile /login/IPSL_CODE/AssimilBranche/modeles/ORCHIDEE/src_stomate/stomate_phenology.f90 /login/IPSL_CODE/ORCHIDEE_1_9_5_2/modeles/ORCHIDEE/src_stomate/stomate_phenology.f90
20c20
<   PUBLIC phenology_main,phenology_clear
---
>   PUBLIC phenology,phenology_clear
23c23
<   LOGICAL, SAVE                                              :: firstcall_phenology = .TRUE.
---
>   LOGICAL, SAVE                                              :: firstcall = .TRUE.
29,31d28
<   REAL(r_std), PARAMETER                                   :: moiavail_always_tree = un
<   REAL(r_std), PARAMETER                                   :: moiavail_always_grass = 0.6
< 
33,34d29
< ! List of subroutines for initialization :
< !- phenology_clear
37c32
<     firstcall_phenology=.TRUE.
---
>     firstcall=.TRUE.
44c39
<   SUBROUTINE phenology_main (kjpindex, dt_days, PFTpresent, &
---
>   SUBROUTINE phenology (npts, dt, PFTpresent, &
52c47
<        when_growthinit, co2_to_bm_dgvm, lai)
---
>        when_growthinit, co2_to_bm, lai)
61c56
<     INTEGER(i_std), INTENT(in)                                        :: kjpindex
---
>     INTEGER(i_std), INTENT(in)                                        :: npts
63c58
<     REAL(r_std), INTENT(in)                                     :: dt_days
---
>     REAL(r_std), INTENT(in)                                     :: dt
65c60
<     LOGICAL, DIMENSION(kjpindex,nvm), INTENT(in)                  :: PFTpresent
---
>     LOGICAL, DIMENSION(npts,nvm), INTENT(in)                  :: PFTpresent
67c62
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)               :: veget_max
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)               :: veget_max
69c64
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                    :: tlong_ref
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                    :: tlong_ref
71c66
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                    :: t2m_month
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                    :: t2m_month
73c68
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                    :: t2m_week
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                    :: t2m_week
75c70
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)               :: gpp
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)               :: gpp
77c72
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)               :: maxmoiavail_lastyear
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)               :: maxmoiavail_lastyear
79c74
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)               :: minmoiavail_lastyear
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)               :: minmoiavail_lastyear
81c76
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)               :: moiavail_month
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)               :: moiavail_month
83c78
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)               :: moiavail_week
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)               :: moiavail_week
85c80
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)               :: gdd_m5_dormance
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)               :: gdd_m5_dormance
87c82
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)               :: gdd_midwinter
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)               :: gdd_midwinter
89c84
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)               :: ncd_dormance
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)               :: ncd_dormance
91c86
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)               :: ngd_minus5
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)               :: ngd_minus5
93c88
<     LOGICAL, DIMENSION(kjpindex,nvm), INTENT(in)                  :: senescence
---
>     LOGICAL, DIMENSION(npts,nvm), INTENT(in)                  :: senescence
95c90
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)               :: time_lowgpp
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)               :: time_lowgpp
97c92
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)               :: time_hum_min
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)               :: time_hum_min
102c97
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts), INTENT(inout)     :: biomass
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(inout)     :: biomass
104c99
<     REAL(r_std), DIMENSION(kjpindex,nvm,nleafages), INTENT(inout)  :: leaf_frac
---
>     REAL(r_std), DIMENSION(npts,nvm,nleafages), INTENT(inout)  :: leaf_frac
106c101
<     REAL(r_std), DIMENSION(kjpindex,nvm,nleafages), INTENT(inout)  :: leaf_age
---
>     REAL(r_std), DIMENSION(npts,nvm,nleafages), INTENT(inout)  :: leaf_age
108c103
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)            :: when_growthinit
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)            :: when_growthinit
111c106
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)                 :: co2_to_bm_dgvm
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)                 :: co2_to_bm
116c111
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)              :: lai
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)              :: lai
125c120
<     LOGICAL, DIMENSION(kjpindex,nvm)                              :: allow_initpheno
---
>     LOGICAL, DIMENSION(npts,nvm)                              :: allow_initpheno
127c122
<     REAL(r_std), DIMENSION(kjpindex)                                :: bm_wanted
---
>     REAL(r_std), DIMENSION(npts)                                :: bm_wanted
129c124
<     REAL(r_std), DIMENSION(kjpindex)                                :: bm_use
---
>     REAL(r_std), DIMENSION(npts)                                :: bm_use
131c126
<     REAL(r_std), DIMENSION(kjpindex)                                :: lm_min
---
>     REAL(r_std), DIMENSION(npts)                                :: lm_min
133c128
<     LOGICAL(r_std), DIMENSION(kjpindex)                             :: age_reset
---
>     LOGICAL(r_std), DIMENSION(npts)                             :: age_reset
137c132
<     LOGICAL, DIMENSION(kjpindex,nvm)                              :: begin_leaves
---
>     LOGICAL, DIMENSION(npts,nvm)                              :: begin_leaves
139c134
<     REAL(r_std), DIMENSION(kjpindex,nvm)                          :: histvar
---
>     REAL(r_std), DIMENSION(npts,nvm)                          :: histvar
149c144
<     IF ( firstcall_phenology ) THEN
---
>     IF ( firstcall ) THEN
159c154
<        firstcall_phenology = .FALSE.
---
>        firstcall = .FALSE.
161d155
<        RETURN
191c185
<     CALL histwrite (hist_id_stomate, 'ALLOW_INITPHENO', itime, histvar, kjpindex*nvm, horipft_index)
---
>     CALL histwrite (hist_id_stomate, 'ALLOW_INITPHENO', itime, histvar, npts*nvm, horipft_index)
198c192
<     when_growthinit(:,:) = when_growthinit(:,:) + dt_days
---
>     when_growthinit(:,:) = when_growthinit(:,:) + dt
215c209
<           CALL pheno_hum (kjpindex, j, PFTpresent, allow_initpheno, &
---
>           CALL pheno_hum (npts, j, PFTpresent, allow_initpheno, &
222c216
<           CALL pheno_moi (kjpindex, j, PFTpresent, allow_initpheno, &
---
>           CALL pheno_moi (npts, j, PFTpresent, allow_initpheno, &
230c224
<           CALL pheno_ncdgdd (kjpindex, j, PFTpresent, allow_initpheno, &
---
>           CALL pheno_ncdgdd (npts, j, PFTpresent, allow_initpheno, &
236c230
<           CALL pheno_ngd (kjpindex, j, PFTpresent, allow_initpheno, ngd_minus5, &
---
>           CALL pheno_ngd (npts, j, PFTpresent, allow_initpheno, ngd_minus5, &
241c235
<           CALL pheno_humgdd (kjpindex, j, PFTpresent, allow_initpheno, gdd_m5_dormance, &
---
>           CALL pheno_humgdd (npts, j, PFTpresent, allow_initpheno, gdd_m5_dormance, &
249c243
<           CALL pheno_moigdd (kjpindex, j, PFTpresent, allow_initpheno, gdd_m5_dormance, &
---
>           CALL pheno_moigdd (npts, j, PFTpresent, allow_initpheno, gdd_m5_dormance, &
275c269
<     CALL histwrite (hist_id_stomate, 'BEGIN_LEAVES', itime, histvar, kjpindex*nvm, horipft_index)
---
>     CALL histwrite (hist_id_stomate, 'BEGIN_LEAVES', itime, histvar, npts*nvm, horipft_index)
286c280
<        DO i = 1, kjpindex
---
>        DO i = 1, npts
307c301
<                    co2_to_bm_dgvm(i,j) = co2_to_bm_dgvm(i,j) + ( bm_wanted(i) - biomass(i,j,icarbres) ) / dt_days
---
>                    co2_to_bm(i,j) = co2_to_bm(i,j) + ( bm_wanted(i) - biomass(i,j,icarbres) ) / dt
377c371
<   END SUBROUTINE phenology_main
---
>   END SUBROUTINE phenology
386c380
<   SUBROUTINE pheno_hum (kjpindex, j, PFTpresent, allow_initpheno, &
---
>   SUBROUTINE pheno_hum (npts, j, PFTpresent, allow_initpheno, &
398c392
<     INTEGER(i_std), INTENT(in)                                     :: kjpindex
---
>     INTEGER(i_std), INTENT(in)                                     :: npts
402c396
<     LOGICAL, DIMENSION(kjpindex,nvm), INTENT(in)               :: PFTpresent
---
>     LOGICAL, DIMENSION(npts,nvm), INTENT(in)               :: PFTpresent
404c398
<     LOGICAL, DIMENSION(kjpindex,nvm), INTENT(in)               :: allow_initpheno
---
>     LOGICAL, DIMENSION(npts,nvm), INTENT(in)               :: allow_initpheno
406c400
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)            :: moiavail_month
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)            :: moiavail_month
408c402
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)            :: moiavail_week
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)            :: moiavail_week
410c404
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)            :: maxmoiavail_lastyear
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)            :: maxmoiavail_lastyear
412c406
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)            :: minmoiavail_lastyear
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)            :: minmoiavail_lastyear
417c411
<     LOGICAL, DIMENSION(kjpindex,nvm), INTENT(inout)              :: begin_leaves
---
>     LOGICAL, DIMENSION(npts,nvm), INTENT(inout)              :: begin_leaves
421a416,417
>     REAL(r_std), PARAMETER                                   :: moiavail_always_tree = un
>     REAL(r_std), PARAMETER                                   :: moiavail_always_grass = 0.6
424c420
<     REAL(r_std), DIMENSION(kjpindex)                             :: availability_crit
---
>     REAL(r_std), DIMENSION(npts)                             :: availability_crit
484c480
<     DO i = 1, kjpindex
---
>     DO i = 1, npts
519c515
<   SUBROUTINE pheno_moi (kjpindex, j, PFTpresent, allow_initpheno, &
---
>   SUBROUTINE pheno_moi (npts, j, PFTpresent, allow_initpheno, &
531c527
<     INTEGER(i_std), INTENT(in)                                     :: kjpindex
---
>     INTEGER(i_std), INTENT(in)                                     :: npts
535c531
<     LOGICAL, DIMENSION(kjpindex,nvm), INTENT(in)               :: PFTpresent
---
>     LOGICAL, DIMENSION(npts,nvm), INTENT(in)               :: PFTpresent
537c533
<     LOGICAL, DIMENSION(kjpindex,nvm), INTENT(in)               :: allow_initpheno
---
>     LOGICAL, DIMENSION(npts,nvm), INTENT(in)               :: allow_initpheno
539c535
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)            :: time_hum_min
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)            :: time_hum_min
541c537
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)            :: moiavail_month
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)            :: moiavail_month
543c539
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)            :: moiavail_week
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)            :: moiavail_week
548c544
<     LOGICAL, DIMENSION(kjpindex,nvm), INTENT(inout)              :: begin_leaves
---
>     LOGICAL, DIMENSION(npts,nvm), INTENT(inout)              :: begin_leaves
616c612
<     DO i = 1, kjpindex
---
>     DO i = 1, npts
647c643
<   SUBROUTINE pheno_humgdd (kjpindex, j, PFTpresent, allow_initpheno, gdd, &
---
>   SUBROUTINE pheno_humgdd (npts, j, PFTpresent, allow_initpheno, gdd, &
660c656
<     INTEGER(i_std), INTENT(in)                                     :: kjpindex
---
>     INTEGER(i_std), INTENT(in)                                     :: npts
664c660
<     LOGICAL, DIMENSION(kjpindex,nvm), INTENT(in)               :: PFTpresent
---
>     LOGICAL, DIMENSION(npts,nvm), INTENT(in)               :: PFTpresent
666c662
<     LOGICAL, DIMENSION(kjpindex,nvm), INTENT(in)               :: allow_initpheno
---
>     LOGICAL, DIMENSION(npts,nvm), INTENT(in)               :: allow_initpheno
668c664
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)            :: gdd
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)            :: gdd
670c666
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)            :: maxmoiavail_lastyear
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)            :: maxmoiavail_lastyear
672c668
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)            :: minmoiavail_lastyear
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)            :: minmoiavail_lastyear
674c670
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                 :: tlong_ref
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                 :: tlong_ref
676c672
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                 :: t2m_month
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                 :: t2m_month
678c674
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                 :: t2m_week
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                 :: t2m_week
680c676
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)            :: moiavail_week
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)            :: moiavail_week
682c678
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)            :: moiavail_month
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)            :: moiavail_month
687c683
<     LOGICAL, DIMENSION(kjpindex,nvm), INTENT(inout)              :: begin_leaves
---
>     LOGICAL, DIMENSION(npts,nvm), INTENT(inout)              :: begin_leaves
699c695
<     REAL(r_std), DIMENSION(kjpindex)                             :: moiavail_crit
---
>     REAL(r_std), DIMENSION(npts)                             :: moiavail_crit
701c697
<     REAL(r_std), DIMENSION(kjpindex)                             :: tl
---
>     REAL(r_std), DIMENSION(npts)                             :: tl
703c699
<     REAL(r_std), DIMENSION(kjpindex)                             :: gdd_crit
---
>     REAL(r_std), DIMENSION(npts)                             :: gdd_crit
774c770
<     DO i = 1, kjpindex
---
>     DO i = 1, npts
813c809
<   SUBROUTINE pheno_moigdd (kjpindex, j, PFTpresent, allow_initpheno, gdd, &
---
>   SUBROUTINE pheno_moigdd (npts, j, PFTpresent, allow_initpheno, gdd, &
826c822
<     INTEGER(i_std), INTENT(in)                                     :: kjpindex
---
>     INTEGER(i_std), INTENT(in)                                     :: npts
830c826
<     LOGICAL, DIMENSION(kjpindex,nvm), INTENT(in)               :: PFTpresent
---
>     LOGICAL, DIMENSION(npts,nvm), INTENT(in)               :: PFTpresent
832c828
<     LOGICAL, DIMENSION(kjpindex,nvm), INTENT(in)               :: allow_initpheno
---
>     LOGICAL, DIMENSION(npts,nvm), INTENT(in)               :: allow_initpheno
834c830
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)            :: gdd
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)            :: gdd
836c832
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)            :: time_hum_min
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)            :: time_hum_min
838c834
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                 :: tlong_ref
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                 :: tlong_ref
840c836
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                 :: t2m_month
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                 :: t2m_month
842c838
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                 :: t2m_week
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                 :: t2m_week
844c840
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)            :: moiavail_week
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)            :: moiavail_week
846c842
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)            :: moiavail_month
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)            :: moiavail_month
851c847
<     LOGICAL, DIMENSION(kjpindex,nvm), INTENT(inout)              :: begin_leaves
---
>     LOGICAL, DIMENSION(npts,nvm), INTENT(inout)              :: begin_leaves
863c859
<     REAL(r_std), DIMENSION(kjpindex)                             :: tl
---
>     REAL(r_std), DIMENSION(npts)                             :: tl
865c861
<     REAL(r_std), DIMENSION(kjpindex)                             :: gdd_crit
---
>     REAL(r_std), DIMENSION(npts)                             :: gdd_crit
936c932
<     DO i = 1, kjpindex
---
>     DO i = 1, npts
973c969
<   SUBROUTINE pheno_ncdgdd (kjpindex, j, PFTpresent, allow_initpheno, &
---
>   SUBROUTINE pheno_ncdgdd (npts, j, PFTpresent, allow_initpheno, &
984c980
<     INTEGER(i_std), INTENT(in)                                     :: kjpindex
---
>     INTEGER(i_std), INTENT(in)                                     :: npts
988c984
<     LOGICAL, DIMENSION(kjpindex,nvm), INTENT(in)               :: PFTpresent
---
>     LOGICAL, DIMENSION(npts,nvm), INTENT(in)               :: PFTpresent
990c986
<     LOGICAL, DIMENSION(kjpindex,nvm), INTENT(in)               :: allow_initpheno
---
>     LOGICAL, DIMENSION(npts,nvm), INTENT(in)               :: allow_initpheno
992c988
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)            :: ncd_dormance
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)            :: ncd_dormance
994c990
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)            :: gdd_midwinter
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)            :: gdd_midwinter
996c992
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                 :: t2m_month
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                 :: t2m_month
998c994
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                 :: t2m_week
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                 :: t2m_week
1003c999
<     LOGICAL, DIMENSION(kjpindex,nvm), INTENT(inout)              :: begin_leaves
---
>     LOGICAL, DIMENSION(npts,nvm), INTENT(inout)              :: begin_leaves
1042c1038
<     DO i = 1, kjpindex
---
>     DO i = 1, npts
1074c1070
<   SUBROUTINE pheno_ngd (kjpindex, j, PFTpresent, allow_initpheno, ngd, &
---
>   SUBROUTINE pheno_ngd (npts, j, PFTpresent, allow_initpheno, ngd, &
1084c1080
<     INTEGER(i_std), INTENT(in)                                     :: kjpindex
---
>     INTEGER(i_std), INTENT(in)                                     :: npts
1088c1084
<     LOGICAL, DIMENSION(kjpindex,nvm), INTENT(in)               :: PFTpresent
---
>     LOGICAL, DIMENSION(npts,nvm), INTENT(in)               :: PFTpresent
1090c1086
<     LOGICAL, DIMENSION(kjpindex,nvm), INTENT(in)               :: allow_initpheno
---
>     LOGICAL, DIMENSION(npts,nvm), INTENT(in)               :: allow_initpheno
1092c1088
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)            :: ngd
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)            :: ngd
1094c1090
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                 :: t2m_month
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                 :: t2m_month
1096c1092
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                 :: t2m_week
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                 :: t2m_week
1101c1097
<     LOGICAL, DIMENSION(kjpindex,nvm), INTENT(inout)              :: begin_leaves
---
>     LOGICAL, DIMENSION(npts,nvm), INTENT(inout)              :: begin_leaves
1138c1134
<     DO i = 1, kjpindex
---
>     DO i = 1, npts
diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile /login/IPSL_CODE/AssimilBranche/modeles/ORCHIDEE/src_stomate/stomate_prescribe.f90 /login/IPSL_CODE/ORCHIDEE_1_9_5_2/modeles/ORCHIDEE/src_stomate/stomate_prescribe.f90
29c29
<     LOGICAL, SAVE                                              :: firstcall_prescribe = .TRUE.
---
>     LOGICAL, SAVE                                              :: firstcall = .TRUE.
32,35d31
< ! List of subroutines for initialization :
< !- prescribe_clear
< 
< !???- prescribe => utilité de l'appel de prescribe dans stomate_init_main ??
38c34
<     firstcall_prescribe=.TRUE.
---
>     firstcall=.TRUE.
41c37
<  SUBROUTINE prescribe (kjpindex, &
---
>  SUBROUTINE prescribe (npts, &
52c48
<     INTEGER(i_std), INTENT(in)                                        :: kjpindex
---
>     INTEGER(i_std), INTENT(in)                                        :: npts
57c53
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)               :: veget_max
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)               :: veget_max
59c55
<     LOGICAL, DIMENSION(kjpindex,nvm), INTENT(inout)               :: PFTpresent
---
>     LOGICAL, DIMENSION(npts,nvm), INTENT(inout)               :: PFTpresent
61c57
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)            :: everywhere
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)            :: everywhere
63c59
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)            :: when_growthinit
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)            :: when_growthinit
65c61
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts), INTENT(inout)     :: biomass
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(inout)     :: biomass
67c63
<     REAL(r_std), DIMENSION(kjpindex,nvm,nleafages), INTENT(inout)  :: leaf_frac
---
>     REAL(r_std), DIMENSION(npts,nvm,nleafages), INTENT(inout)  :: leaf_frac
69c65
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)            :: ind
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)            :: ind
71c67
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)            :: cn_ind
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)            :: cn_ind
81c77
<     REAL(r_std), DIMENSION(kjpindex)                                :: dia
---
>     REAL(r_std), DIMENSION(npts)                                :: dia
83c79
<     REAL(r_std), DIMENSION(kjpindex)                                :: woodmass
---
>     REAL(r_std), DIMENSION(npts)                                :: woodmass
85c81
<     REAL(r_std), DIMENSION(kjpindex)                                :: woodmass_ind
---
>     REAL(r_std), DIMENSION(npts)                                :: woodmass_ind
111c107
<           DO i = 1, kjpindex
---
>           DO i = 1, npts
210c206
<     IF ( firstcall_prescribe ) THEN
---
>     IF ( firstcall ) THEN
221c217
<         DO i = 1, kjpindex
---
>         DO i = 1, npts
293c289
<       firstcall_prescribe = .FALSE.
---
>       firstcall = .FALSE.
diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile /login/IPSL_CODE/AssimilBranche/modeles/ORCHIDEE/src_stomate/stomate_resp.f90 /login/IPSL_CODE/ORCHIDEE_1_9_5_2/modeles/ORCHIDEE/src_stomate/stomate_resp.f90
16c16
<   PUBLIC maint_respiration_main,maint_respiration_clear
---
>   PUBLIC maint_respiration,maint_respiration_clear
19c19
<   LOGICAL, SAVE                                              :: firstcall_resp = .TRUE.
---
>   LOGICAL, SAVE                                              :: firstcall = .TRUE.
22,23d21
< ! List of subroutines for initialization :
< !- maint_respiration_clear
26c24
<     firstcall_resp=.TRUE.
---
>     firstcall=.TRUE.
29c27
<   SUBROUTINE maint_respiration_main ( kjpindex,dt_days,lai, t2m_daily,tlong_ref,stempdiag,height,veget_max,&
---
>   SUBROUTINE maint_respiration ( npts,dt,lai, t2m,tlong_ref,stempdiag,height,veget_max,&
39c37
<     INTEGER(i_std), INTENT(in)                                        :: kjpindex
---
>     INTEGER(i_std), INTENT(in)                                        :: npts
41c39
<     REAL(r_std), INTENT(in)                                     :: dt_days
---
>     REAL(r_std), INTENT(in)                                     :: dt
43c41
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                    :: t2m_daily
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                    :: t2m
45c43
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                    :: tlong_ref
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                    :: tlong_ref
47c45
<     REAL(r_std),DIMENSION (kjpindex,nbdl), INTENT (in)              :: stempdiag
---
>     REAL(r_std),DIMENSION (npts,nbdl), INTENT (in)              :: stempdiag
49c47
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)               :: height
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)               :: height
51c49
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)               :: veget_max
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)               :: veget_max
53c51
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)               :: rprof
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)               :: rprof
55c53
<     REAL(r_std),DIMENSION(kjpindex,nvm,nparts),INTENT(in)          :: biomass 
---
>     REAL(r_std),DIMENSION(npts,nvm,nparts),INTENT(in)          :: biomass 
62c60
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts), INTENT(out)             :: resp_maint_part_radia
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(out)             :: resp_maint_part_radia
66c64,66
<     REAL(r_std), DIMENSION(kjpindex,nvm)                           :: lai
---
>     REAL(r_std), DIMENSION(npts,nvm)                           :: lai
>     ! soil levels (m)
>     REAL(r_std), SAVE, DIMENSION(0:nbdl)                        :: z_soil
68c68
<     REAL(r_std), DIMENSION(kjpindex,nvm)                           :: t_root
---
>     REAL(r_std), DIMENSION(npts,nvm)                           :: t_root
70c70
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts)                    :: coeff_maint
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts)                    :: coeff_maint
72c72
<     REAL(r_std), DIMENSION(kjpindex,nparts)                         :: t_maint
---
>     REAL(r_std), DIMENSION(npts,nparts)                         :: t_maint
74c74
<     REAL(r_std), DIMENSION(kjpindex)                                :: rpc
---
>     REAL(r_std), DIMENSION(npts)                                :: rpc
76c76
<     REAL(r_std), DIMENSION(kjpindex,nparts)                         :: t_maint_radia
---
>     REAL(r_std), DIMENSION(npts,nparts)                         :: t_maint_radia
78c78
<     REAL(r_std), DIMENSION(kjpindex)                                :: tl
---
>     REAL(r_std), DIMENSION(npts)                                :: tl
80c80
<     REAL(r_std), DIMENSION(kjpindex)                                :: slope
---
>     REAL(r_std), DIMENSION(npts)                                :: slope
92c92
<     IF ( firstcall_resp ) THEN
---
>     IF ( firstcall ) THEN
95a96,98
>        z_soil(0) = zero
>        z_soil(1:nbdl) = diaglev(1:nbdl)
> 
100,101c103,104
<        firstcall_resp = .FALSE.
<        RETURN
---
>        firstcall = .FALSE.
> 
138,140c141,143
<        t_maint_radia(:,ileaf) = t2m_daily(:)
<        t_maint_radia(:,isapabove) = t2m_daily(:)
<        t_maint_radia(:,ifruit) = t2m_daily(:)
---
>        t_maint_radia(:,ileaf) = t2m(:)
>        t_maint_radia(:,isapabove) = t2m(:)
>        t_maint_radia(:,ifruit) = t2m(:)
150c153
<        t_maint_radia(:,iheartabove) = t2m_daily(:)
---
>        t_maint_radia(:,iheartabove) = t2m(:)
155c158
<           t_maint_radia(:,icarbres) = t2m_daily(:)
---
>           t_maint_radia(:,icarbres) = t2m(:)
171c174
<                MAX( (coeff_maint_zero(j,k)*dt_days/one_day) * &
---
>                MAX( (coeff_maint_zero(j,k)*dt/one_day) * &
203c206
<              DO i = 1, kjpindex
---
>              DO i = 1, npts
237c240
<   END SUBROUTINE maint_respiration_main
---
>   END SUBROUTINE maint_respiration
diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile /login/IPSL_CODE/AssimilBranche/modeles/ORCHIDEE/src_stomate/stomate_season.f90 /login/IPSL_CODE/ORCHIDEE_1_9_5_2/modeles/ORCHIDEE/src_stomate/stomate_season.f90
21c21
<   PUBLIC season_main,season_clear
---
>   PUBLIC season,season_clear
24c24
<   LOGICAL, SAVE                                          :: firstcall_season = .TRUE.
---
>   LOGICAL, SAVE                                          :: firstcall = .TRUE.
27,28c27
< ! List of subroutines for initialization :
< !- season_clear
---
> 
31c30
<     firstcall_season=.TRUE.
---
>     firstcall=.TRUE.
34c33
<   SUBROUTINE season_main (kjpindex, dt_days, EndOfYear, veget, veget_max, &
---
>   SUBROUTINE season (npts, dt, EndOfYear, veget, veget_max, &
57c56
<     INTEGER(i_std), INTENT(in)                                    :: kjpindex
---
>     INTEGER(i_std), INTENT(in)                                    :: npts
59c58
<     REAL(r_std), INTENT(in)                                 :: dt_days
---
>     REAL(r_std), INTENT(in)                                 :: dt
63c62
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)           :: veget
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)           :: veget
66c65
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)           :: veget_max
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)           :: veget_max
68c67
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)           :: moiavail_daily
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)           :: moiavail_daily
70c69
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                :: t2m_daily
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                :: t2m_daily
72c71
<     REAL(r_std), DIMENSION(kjpindex,nbdl), INTENT(in)           :: tsoil_daily
---
>     REAL(r_std), DIMENSION(npts,nbdl), INTENT(in)           :: tsoil_daily
74c73
<     REAL(r_std), DIMENSION(kjpindex,nbdl), INTENT(in)           :: soilhum_daily
---
>     REAL(r_std), DIMENSION(npts,nbdl), INTENT(in)           :: soilhum_daily
76c75
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                :: precip_daily
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                :: precip_daily
78c77
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)           :: npp_daily
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)           :: npp_daily
80c79
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts), INTENT(in)    :: biomass
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(in)    :: biomass
82c81
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts), INTENT(in)    :: turnover_daily
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(in)    :: turnover_daily
84c83
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)           :: gpp_daily
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)           :: gpp_daily
86c85
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)           :: when_growthinit
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)           :: when_growthinit
91c90
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)        :: maxmoiavail_lastyear
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)        :: maxmoiavail_lastyear
93c92
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)        :: maxmoiavail_thisyear
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)        :: maxmoiavail_thisyear
95c94
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)        :: minmoiavail_lastyear
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)        :: minmoiavail_lastyear
97c96
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)        :: minmoiavail_thisyear
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)        :: minmoiavail_thisyear
99c98
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)        :: maxgppweek_lastyear
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)        :: maxgppweek_lastyear
101c100
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)        :: maxgppweek_thisyear
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)        :: maxgppweek_thisyear
103c102
<     REAL(r_std), DIMENSION(kjpindex), INTENT(inout)             :: gdd0_lastyear
---
>     REAL(r_std), DIMENSION(npts), INTENT(inout)             :: gdd0_lastyear
105c104
<     REAL(r_std), DIMENSION(kjpindex), INTENT(inout)             :: gdd0_thisyear
---
>     REAL(r_std), DIMENSION(npts), INTENT(inout)             :: gdd0_thisyear
107c106
<     REAL(r_std), DIMENSION(kjpindex), INTENT(inout)             :: precip_lastyear
---
>     REAL(r_std), DIMENSION(npts), INTENT(inout)             :: precip_lastyear
109c108
<     REAL(r_std), DIMENSION(kjpindex), INTENT(inout)             :: precip_thisyear
---
>     REAL(r_std), DIMENSION(npts), INTENT(inout)             :: precip_thisyear
111c110
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)        :: lm_lastyearmax
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)        :: lm_lastyearmax
113c112
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)        :: lm_thisyearmax
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)        :: lm_thisyearmax
115c114
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)        :: maxfpc_lastyear
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)        :: maxfpc_lastyear
117c116
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)        :: maxfpc_thisyear
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)        :: maxfpc_thisyear
119c118
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)        :: moiavail_month
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)        :: moiavail_month
121c120
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)        :: moiavail_week
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)        :: moiavail_week
123c122
<     REAL(r_std), DIMENSION(kjpindex), INTENT(inout)             :: t2m_longterm
---
>     REAL(r_std), DIMENSION(npts), INTENT(inout)             :: t2m_longterm
125c124
<     REAL(r_std), DIMENSION(kjpindex), INTENT(inout)             :: tlong_ref
---
>     REAL(r_std), DIMENSION(npts), INTENT(inout)             :: tlong_ref
127c126
<     REAL(r_std), DIMENSION(kjpindex), INTENT(inout)             :: t2m_month
---
>     REAL(r_std), DIMENSION(npts), INTENT(inout)             :: t2m_month
129c128
<     REAL(r_std), DIMENSION(kjpindex), INTENT(inout)             :: t2m_week
---
>     REAL(r_std), DIMENSION(npts), INTENT(inout)             :: t2m_week
131c130
<     REAL(r_std), DIMENSION(kjpindex,nbdl), INTENT(inout)        :: tsoil_month
---
>     REAL(r_std), DIMENSION(npts,nbdl), INTENT(inout)        :: tsoil_month
133c132
<     REAL(r_std), DIMENSION(kjpindex,nbdl), INTENT(inout)        :: soilhum_month
---
>     REAL(r_std), DIMENSION(npts,nbdl), INTENT(inout)        :: soilhum_month
135c134
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)        :: npp_longterm
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)        :: npp_longterm
137c136
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts), INTENT(inout) :: turnover_longterm
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(inout) :: turnover_longterm
139c138
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)        :: gpp_week
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)        :: gpp_week
141c140
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)        :: gdd_m5_dormance
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)        :: gdd_m5_dormance
143c142
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)        :: gdd_midwinter
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)        :: gdd_midwinter
145c144
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)        :: ncd_dormance
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)        :: ncd_dormance
147c146
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)        :: ngd_minus5
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)        :: ngd_minus5
149c148
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)        :: time_lowgpp
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)        :: time_lowgpp
151c150
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)        :: time_hum_min
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)        :: time_hum_min
153c152
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)        :: hum_min_dormance
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)        :: hum_min_dormance
158c157
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(out)          :: herbivores
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(out)          :: herbivores
178c177
<     REAL(r_std), PARAMETER                                  :: leaf_frac_season=.33
---
>     REAL(r_std), PARAMETER                                  :: leaf_frac=.33
180c179
<     REAL(r_std), DIMENSION(kjpindex)                            :: sumfpc_nat
---
>     REAL(r_std), DIMENSION(npts)                            :: sumfpc_nat
182c181
<     REAL(r_std), DIMENSION(kjpindex)                            :: weighttot
---
>     REAL(r_std), DIMENSION(npts)                            :: weighttot
184c183
<     REAL(r_std), DIMENSION(kjpindex)                            :: nlflong_nat
---
>     REAL(r_std), DIMENSION(npts)                            :: nlflong_nat
186c185
<     REAL(r_std), DIMENSION(kjpindex)                            :: green_age
---
>     REAL(r_std), DIMENSION(npts)                            :: green_age
188c187
<     REAL(r_std), DIMENSION(kjpindex)                            :: consumption
---
>     REAL(r_std), DIMENSION(npts)                            :: consumption
190c189
<     REAL(r_std), DIMENSION(kjpindex)                            :: fracnat
---
>     REAL(r_std), DIMENSION(npts)                            :: fracnat
201c200
<     IF ( firstcall_season ) THEN
---
>     IF ( firstcall ) THEN
217c216
<           WRITE(numout,*) '   > for herbivores, suppose that ',leaf_frac_season*100., &
---
>           WRITE(numout,*) '   > for herbivores, suppose that ',leaf_frac*100., &
356,357c355,356
<        firstcall_season = .FALSE.
<        RETURN
---
>        firstcall = .FALSE.
> 
368,369c367,368
<     moiavail_month = ( moiavail_month * ( pheno_crit%tau_hum_month - dt_days ) + &
<          moiavail_daily * dt_days ) / pheno_crit%tau_hum_month
---
>     moiavail_month = ( moiavail_month * ( pheno_crit%tau_hum_month - dt ) + &
>          moiavail_daily * dt ) / pheno_crit%tau_hum_month
381,382c380,381
<     moiavail_week = ( moiavail_week * ( pheno_crit%tau_hum_week - dt_days ) + &
<          moiavail_daily * dt_days ) / pheno_crit%tau_hum_week
---
>     moiavail_week = ( moiavail_week * ( pheno_crit%tau_hum_week - dt ) + &
>          moiavail_daily * dt ) / pheno_crit%tau_hum_week
398,399c397,398
<     t2m_longterm = ( t2m_longterm * ( pheno_crit%tau_longterm - dt_days ) + &
<          t2m_daily * dt_days ) / pheno_crit%tau_longterm
---
>     t2m_longterm = ( t2m_longterm * ( pheno_crit%tau_longterm - dt ) + &
>          t2m_daily * dt ) / pheno_crit%tau_longterm
406c405
<          t2m_longterm, kjpindex, hori_index)
---
>          t2m_longterm, npts, hori_index)
423,424c422,423
<     t2m_month = ( t2m_month * ( pheno_crit%tau_t2m_month - dt_days ) + &
<          t2m_daily * dt_days ) / pheno_crit%tau_t2m_month
---
>     t2m_month = ( t2m_month * ( pheno_crit%tau_t2m_month - dt ) + &
>          t2m_daily * dt ) / pheno_crit%tau_t2m_month
434,435c433,434
<     t2m_week = ( t2m_week * ( pheno_crit%tau_t2m_week - dt_days ) + &
<          t2m_daily * dt_days ) / pheno_crit%tau_t2m_week
---
>     t2m_week = ( t2m_week * ( pheno_crit%tau_t2m_week - dt ) + &
>          t2m_daily * dt ) / pheno_crit%tau_t2m_week
445,446c444,445
<     tsoil_month = ( tsoil_month * ( pheno_crit%tau_tsoil_month - dt_days ) + &
<          tsoil_daily(:,:) * dt_days ) / pheno_crit%tau_tsoil_month
---
>     tsoil_month = ( tsoil_month * ( pheno_crit%tau_tsoil_month - dt ) + &
>          tsoil_daily(:,:) * dt ) / pheno_crit%tau_tsoil_month
456,457c455,456
<     soilhum_month = ( soilhum_month * ( pheno_crit%tau_soilhum_month - dt_days ) + &
<          soilhum_daily * dt_days ) / pheno_crit%tau_soilhum_month
---
>     soilhum_month = ( soilhum_month * ( pheno_crit%tau_soilhum_month - dt ) + &
>          soilhum_daily * dt ) / pheno_crit%tau_soilhum_month
481c480
<           time_lowgpp(:,j) = time_lowgpp(:,j) + dt_days
---
>           time_lowgpp(:,j) = time_lowgpp(:,j) + dt
529c528
<                   dt_days * ( t2m_daily(:) - (ZeroCelsius-5.) )
---
>                   dt * ( t2m_daily(:) - (ZeroCelsius-5.) )
534c533
<                   ( pheno_crit%tau_gdd - dt_days ) / pheno_crit%tau_gdd
---
>                   ( pheno_crit%tau_gdd - dt ) / pheno_crit%tau_gdd
589c588
<                   dt_days * ( t2m_daily(:) - ( pheno_crit%ncdgdd_temp(j)+ZeroCelsius ) )
---
>                   dt * ( t2m_daily(:) - ( pheno_crit%ncdgdd_temp(j)+ZeroCelsius ) )
632c631
<              ncd_dormance(:,j) = MIN( ncd_dormance(:,j) + dt_days, ncd_max )
---
>              ncd_dormance(:,j) = MIN( ncd_dormance(:,j) + dt, ncd_max )
660c659
<           ngd_minus5(:,j) = ngd_minus5(:,j) + dt_days
---
>           ngd_minus5(:,j) = ngd_minus5(:,j) + dt
663c662
<        ngd_minus5(:,j) = ngd_minus5(:,j) * ( pheno_crit%tau_ngd - dt_days ) / pheno_crit%tau_ngd
---
>        ngd_minus5(:,j) = ngd_minus5(:,j) * ( pheno_crit%tau_ngd - dt ) / pheno_crit%tau_ngd
712c711
<              time_hum_min(:,j) = time_hum_min(:,j) + dt_days
---
>              time_hum_min(:,j) = time_hum_min(:,j) + dt
735,736c734,735
<     npp_longterm = ( npp_longterm * ( pheno_crit%tau_longterm - dt_days ) + &
<          (npp_daily*one_year) * dt_days                          ) / &
---
>     npp_longterm = ( npp_longterm * ( pheno_crit%tau_longterm - dt ) + &
>          (npp_daily*one_year) * dt                          ) / &
749,750c748,749
<     turnover_longterm = ( turnover_longterm * ( pheno_crit%tau_longterm - dt_days ) + &
<          (turnover_daily*one_year) * dt_days                          ) / &
---
>     turnover_longterm = ( turnover_longterm * ( pheno_crit%tau_longterm - dt ) + &
>          (turnover_daily*one_year) * dt                          ) / &
767,768c766,767
<        gpp_week = ( gpp_week * ( pheno_crit%tau_gpp_week - dt_days ) + &
<             gpp_daily * dt_days ) / pheno_crit%tau_gpp_week
---
>        gpp_week = ( gpp_week * ( pheno_crit%tau_gpp_week - dt ) + &
>             gpp_daily * dt ) / pheno_crit%tau_gpp_week
807c806
<        gdd0_thisyear = gdd0_thisyear + dt_days * ( t2m_daily - ZeroCelsius )
---
>        gdd0_thisyear = gdd0_thisyear + dt * ( t2m_daily - ZeroCelsius )
814c813
<     precip_thisyear = precip_thisyear + dt_days * precip_daily
---
>     precip_thisyear = precip_thisyear + dt * precip_daily
840,841c839,840
<                    maxfpc_lastyear(:,j) = ( maxfpc_lastyear(:,j) * ( one_year/leaflife_tab(j)- dt_days ) + &
<                         veget(:,j) / fracnat(:) * dt_days ) / (one_year/leaflife_tab(j))
---
>                    maxfpc_lastyear(:,j) = ( maxfpc_lastyear(:,j) * ( one_year/leaflife_tab(j)- dt ) + &
>                         veget(:,j) / fracnat(:) * dt ) / (one_year/leaflife_tab(j))
849,850c848,849
< !!$                lm_lastyearmax(:,j) = ( lm_lastyearmax(:,j) * ( one_year/leaflife_tab(j)- dt_days ) + &
< !!$                     biomass(:,j,ileaf) * dt_days ) / (one_year/leaflife_tab(j))
---
> !!$                lm_lastyearmax(:,j) = ( lm_lastyearmax(:,j) * ( one_year/leaflife_tab(j)- dt ) + &
> !!$                     biomass(:,j,ileaf) * dt ) / (one_year/leaflife_tab(j))
855,856c854,855
<                    lm_thisyearmax(:,j) = ( lm_thisyearmax(:,j) * ( one_year/leaflife_tab(j)- dt_days ) + &
<                         biomass(:,j,ileaf) * dt_days ) / (one_year/leaflife_tab(j))
---
>                    lm_thisyearmax(:,j) = ( lm_thisyearmax(:,j) * ( one_year/leaflife_tab(j)- dt ) + &
>                         biomass(:,j,ileaf) * dt ) / (one_year/leaflife_tab(j))
996c995
<           nlflong_nat(:) = nlflong_nat(:) + npp_longterm(:,j) * leaf_frac_season
---
>           nlflong_nat(:) = nlflong_nat(:) + npp_longterm(:,j) * leaf_frac
1041c1040
<   END SUBROUTINE season_main
---
>   END SUBROUTINE season
diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile /login/IPSL_CODE/AssimilBranche/modeles/ORCHIDEE/src_stomate/stomate_soilcarbon.f90 /login/IPSL_CODE/ORCHIDEE_1_9_5_2/modeles/ORCHIDEE/src_stomate/stomate_soilcarbon.f90
21c21
<   PUBLIC soilcarbon_main,soilcarbon_clear
---
>   PUBLIC soilcarbon,soilcarbon_clear
24c24
<   LOGICAL, SAVE                                                     :: firstcall_soilcarbon = .TRUE.
---
>   LOGICAL, SAVE                                                     :: firstcall = .TRUE.
27,28c27
< ! List of subroutines for initialization :
< !- soilcarbon_clear
---
> 
31c30
<     firstcall_soilcarbon=.TRUE.
---
>     firstcall=.TRUE.
34c33
<   SUBROUTINE soilcarbon_main (kjpindex, dt_days, clayfraction, &
---
>   SUBROUTINE soilcarbon (npts, dt, clay, &
46c45
<     INTEGER(i_std), INTENT(in)                                               :: kjpindex
---
>     INTEGER(i_std), INTENT(in)                                               :: npts
48c47
<     REAL(r_std), INTENT(in)                                            :: dt_days
---
>     REAL(r_std), INTENT(in)                                            :: dt
50c49
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                           :: clayfraction
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                           :: clay
53c52
<     REAL(r_std), DIMENSION(kjpindex,ncarb,nvm), INTENT(in)           :: soilcarbon_input
---
>     REAL(r_std), DIMENSION(npts,ncarb,nvm), INTENT(in)           :: soilcarbon_input
55c54
<     REAL(r_std), DIMENSION(kjpindex,nlevs), INTENT(in)                     :: control_temp
---
>     REAL(r_std), DIMENSION(npts,nlevs), INTENT(in)                     :: control_temp
57c56
<     REAL(r_std), DIMENSION(kjpindex,nlevs), INTENT(in)                     :: control_moist
---
>     REAL(r_std), DIMENSION(npts,nlevs), INTENT(in)                     :: control_moist
62c61
<     REAL(r_std), DIMENSION(kjpindex,ncarb,nvm), INTENT(inout)        :: carbon
---
>     REAL(r_std), DIMENSION(npts,ncarb,nvm), INTENT(inout)        :: carbon
67c66
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(out)                :: resp_hetero_soil
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(out)                :: resp_hetero_soil
74c73
<     REAL(r_std), DIMENSION(kjpindex,ncarb,ncarb)                           :: frac_carb
---
>     REAL(r_std), DIMENSION(npts,ncarb,ncarb)                           :: frac_carb
76c75
<     REAL(r_std), DIMENSION(kjpindex,ncarb)                                 :: frac_resp
---
>     REAL(r_std), DIMENSION(npts,ncarb)                                 :: frac_resp
78c77
<     REAL(r_std), DIMENSION(kjpindex,ncarb)                                 :: fluxtot
---
>     REAL(r_std), DIMENSION(npts,ncarb)                                 :: fluxtot
80c79
<     REAL(r_std), DIMENSION(kjpindex,ncarb,ncarb)                           :: flux
---
>     REAL(r_std), DIMENSION(npts,ncarb,ncarb)                           :: flux
94,95d92
<     IF ( firstcall_soilcarbon ) THEN
< 
100c97,121
<        ! 1.1.1 residence times in carbon pools (days)
---
>     ! 1.1.1 flux fractions between carbon pools: depend on clay content, recalculated
>     !       each time
> 
>     ! 1.1.1.1 from active pool: depends on clay content
> 
>     frac_carb(:,iactive,iactive) = zero
>     frac_carb(:,iactive,ipassive) = 0.004
>     frac_carb(:,iactive,islow) = un - (.85-.68*clay(:)) - frac_carb(:,iactive,ipassive)
> 
>     ! 1.1.1.2 from slow pool
> 
>     frac_carb(:,islow,islow) = .0
>     frac_carb(:,islow,iactive) = .42
>     frac_carb(:,islow,ipassive) = .03
> 
>     ! 1.1.1.3 from passive pool
> 
>     frac_carb(:,ipassive,ipassive) = .0
>     frac_carb(:,ipassive,iactive) = .45
>     frac_carb(:,ipassive,islow) = .0
> 
> 
>     IF ( firstcall ) THEN
> 
>        ! 1.1.2 residence times in carbon pools (days)
107c128
<        ! 1.1.2 messages
---
>        ! 1.2 messages
123c144
<        firstcall_soilcarbon = .FALSE.
---
>        firstcall = .FALSE.
125d145
<        RETURN
128,148d147
<     ! 1.1.3 flux fractions between carbon pools: depend on clay content, recalculated
<     !       each time
< 
<     ! 1.1.3.1 from active pool: depends on clay content
< 
<     frac_carb(:,iactive,iactive) = zero
<     frac_carb(:,iactive,ipassive) = 0.004
<     frac_carb(:,iactive,islow) = un - (.85-.68*clayfraction(:)) - frac_carb(:,iactive,ipassive)
< 
<     ! 1.1.3.2 from slow pool
< 
<     frac_carb(:,islow,islow) = .0
<     frac_carb(:,islow,iactive) = .42
<     frac_carb(:,islow,ipassive) = .03
< 
<     ! 1.1.3.3 from passive pool
< 
<     frac_carb(:,ipassive,ipassive) = .0
<     frac_carb(:,ipassive,iactive) = .45
<     frac_carb(:,ipassive,islow) = .0
< 
150c149
<     ! 1.2 set output to zero
---
>     ! 1.3 set output to zero
159c158
<     carbon(:,:,:) = carbon(:,:,:) + soilcarbon_input(:,:,:) * dt_days
---
>     carbon(:,:,:) = carbon(:,:,:) + soilcarbon_input(:,:,:) * dt
188c187
<              fluxtot(:,k) = dt_days/carbon_tau(k) * carbon(:,k,m) * &
---
>              fluxtot(:,k) = dt/carbon_tau(k) * carbon(:,k,m) * &
191c190
<              fluxtot(:,k) = dt_days/carbon_tau(k) * carbon(:,k,m) * &
---
>              fluxtot(:,k) = dt/carbon_tau(k) * carbon(:,k,m) * &
194c193
<              fluxtot(:,k) = dt_days/carbon_tau(k) * carbon(:,k,m) * &
---
>              fluxtot(:,k) = dt/carbon_tau(k) * carbon(:,k,m) * &
199c198
<              fluxtot(:,k) = fluxtot(:,k) * ( un - .75 * clayfraction(:) )
---
>              fluxtot(:,k) = fluxtot(:,k) * ( un - .75 * clay(:) )
216c215
<        !       resp_hetero_soil(:,m) = SUM( frac_resp(:,:) * fluxtot(:,:), DIM=2 ) / dt_days
---
>        !       resp_hetero_soil(:,m) = SUM( frac_resp(:,:) * fluxtot(:,:), DIM=2 ) / dt
221c220
<             frac_resp(:,ipassive) * fluxtot(:,ipassive)  ) / dt_days
---
>             frac_resp(:,ipassive) * fluxtot(:,ipassive)  ) / dt
236c235
<   END SUBROUTINE soilcarbon_main
---
>   END SUBROUTINE soilcarbon
diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile /login/IPSL_CODE/AssimilBranche/modeles/ORCHIDEE/src_stomate/stomate_turnover.f90 /login/IPSL_CODE/ORCHIDEE_1_9_5_2/modeles/ORCHIDEE/src_stomate/stomate_turnover.f90
24c24
<   PUBLIC turn_main, turn_clear
---
>   PUBLIC turn, turn_clear
27c27
<   LOGICAL, SAVE                                              :: firstcall_turnover = .TRUE.
---
>   LOGICAL, SAVE                                              :: firstcall = .TRUE.
30,31d29
< ! List of subroutines for initialization :
< !- turn_clear
34c32
<     firstcall_turnover=.TRUE.
---
>     firstcall=.TRUE.
37c35
<   SUBROUTINE turn_main (kjpindex, dt_days, PFTpresent, &
---
>   SUBROUTINE turn (npts, dt, PFTpresent, &
42c40
<        turnover_daily, senescence,turnover_time)
---
>        turnover, senescence,turnover_time)
51c49
<     INTEGER(i_std), INTENT(in)                                        :: kjpindex
---
>     INTEGER(i_std), INTENT(in)                                        :: npts
53c51
<     REAL(r_std), INTENT(in)                                     :: dt_days
---
>     REAL(r_std), INTENT(in)                                     :: dt
55c53
<     LOGICAL, DIMENSION(kjpindex,nvm), INTENT(in)                  :: PFTpresent
---
>     LOGICAL, DIMENSION(npts,nvm), INTENT(in)                  :: PFTpresent
57c55
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)               :: herbivores
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)               :: herbivores
59c57
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)               :: maxmoiavail_lastyear
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)               :: maxmoiavail_lastyear
61c59
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)               :: minmoiavail_lastyear
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)               :: minmoiavail_lastyear
63c61
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)               :: moiavail_week
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)               :: moiavail_week
65c63
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)               :: moiavail_month
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)               :: moiavail_month
67c65
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                    :: tlong_ref
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                    :: tlong_ref
69c67
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                    :: t2m_month
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                    :: t2m_month
71c69
<     REAL(r_std), DIMENSION(kjpindex), INTENT(in)                    :: t2m_week
---
>     REAL(r_std), DIMENSION(npts), INTENT(in)                    :: t2m_week
73c71
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)               :: veget_max
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)               :: veget_max
78c76
<     REAL(r_std), DIMENSION(kjpindex,nvm,nleafages), INTENT(inout)  :: leaf_age
---
>     REAL(r_std), DIMENSION(npts,nvm,nleafages), INTENT(inout)  :: leaf_age
80c78
<     REAL(r_std), DIMENSION(kjpindex,nvm,nleafages), INTENT(inout)  :: leaf_frac
---
>     REAL(r_std), DIMENSION(npts,nvm,nleafages), INTENT(inout)  :: leaf_frac
82c80
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)            :: age
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)            :: age
84c82
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(in)            :: lai
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(in)            :: lai
86c84
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts), INTENT(inout)     :: biomass
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(inout)     :: biomass
88c86
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(inout)            :: turnover_time
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)            :: turnover_time
93c91
<     REAL(r_std), DIMENSION(kjpindex,nvm,nparts), INTENT(out)       :: turnover_daily
---
>     REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(out)       :: turnover
96c94
<     LOGICAL, DIMENSION(kjpindex,nvm), INTENT(out)                 :: senescence
---
>     LOGICAL, DIMENSION(npts,nvm), INTENT(out)                 :: senescence
103c101
<     REAL(r_std), DIMENSION(kjpindex,nvm)                           :: leaf_meanage
---
>     REAL(r_std), DIMENSION(npts,nvm)                           :: leaf_meanage
105c103
<     REAL(r_std), DIMENSION(kjpindex)                                :: dturnover
---
>     REAL(r_std), DIMENSION(npts)                                :: dturnover
107c105
<     REAL(r_std), DIMENSION(kjpindex)                                :: moiavail_crit
---
>     REAL(r_std), DIMENSION(npts)                                :: moiavail_crit
109c107
<     REAL(r_std), DIMENSION(kjpindex)                                :: tl
---
>     REAL(r_std), DIMENSION(npts)                                :: tl
111c109
<     REAL(r_std), DIMENSION(kjpindex)                                :: t_crit
---
>     REAL(r_std), DIMENSION(npts)                                :: t_crit
113c111
<     LOGICAL, DIMENSION(kjpindex)                                   :: shed_rest
---
>     LOGICAL, DIMENSION(npts)                                   :: shed_rest
115c113
<     REAL(r_std), DIMENSION(kjpindex)                                :: sapconv
---
>     REAL(r_std), DIMENSION(npts)                                :: sapconv
117c115
<     REAL(r_std), DIMENSION(kjpindex)                                :: hw_old
---
>     REAL(r_std), DIMENSION(npts)                                :: hw_old
119c117
<     REAL(r_std), DIMENSION(kjpindex)                                :: hw_new
---
>     REAL(r_std), DIMENSION(npts)                                :: hw_new
121c119
<     REAL(r_std), DIMENSION(kjpindex)                                :: lm_old
---
>     REAL(r_std), DIMENSION(npts)                                :: lm_old
123c121
<     REAL(r_std), DIMENSION(kjpindex,nleafages)                      :: delta_lm
---
>     REAL(r_std), DIMENSION(npts,nleafages)                      :: delta_lm
125c123
<     REAL(r_std), DIMENSION(kjpindex)                                :: turnover_rate
---
>     REAL(r_std), DIMENSION(npts)                                :: turnover_rate
127c125
<     REAL(r_std), DIMENSION(kjpindex,nvm)                           :: leaf_age_crit
---
>     REAL(r_std), DIMENSION(npts,nvm)                           :: leaf_age_crit
129c127
<     REAL(r_std), DIMENSION(kjpindex,nvm)                           :: new_turnover_time
---
>     REAL(r_std), DIMENSION(npts,nvm)                           :: new_turnover_time
141c139
<     IF ( firstcall_turnover ) THEN
---
>     IF ( firstcall ) THEN
147,148c145,146
<        firstcall_turnover = .FALSE.
<        RETURN
---
>        firstcall = .FALSE.
> 
160c158
<     turnover_daily(:,:,:) = zero
---
>     turnover(:,:,:) = zero
278c276
<              turnover_time(:,j)=(turnover_time(:,j)*10./dt_days+new_turnover_time(:,j))/(10./dt_days+1.)
---
>              turnover_time(:,j)=(turnover_time(:,j)*10./dt+new_turnover_time(:,j))/(10./dt+1.)
305,306c303,304
<              turnover_daily(:,j,ileaf) = biomass(:,j,ileaf) * dt_days / pheno_crit%leaffall(j)
<              turnover_daily(:,j,iroot) = biomass(:,j,iroot) * dt_days / pheno_crit%leaffall(j)
---
>              turnover(:,j,ileaf) = biomass(:,j,ileaf) * dt / pheno_crit%leaffall(j)
>              turnover(:,j,iroot) = biomass(:,j,iroot) * dt / pheno_crit%leaffall(j)
308,309c306,307
<              biomass(:,j,ileaf) = biomass(:,j,ileaf) - turnover_daily(:,j,ileaf)
<              biomass(:,j,iroot) = biomass(:,j,iroot) - turnover_daily(:,j,iroot)
---
>              biomass(:,j,ileaf) = biomass(:,j,ileaf) - turnover(:,j,ileaf)
>              biomass(:,j,iroot) = biomass(:,j,iroot) - turnover(:,j,iroot)
317,320c315,318
<              turnover_daily(:,j,ileaf) = biomass(:,j,ileaf) * dt_days / turnover_time(:,j)
<              turnover_daily(:,j,isapabove) = biomass(:,j,isapabove) * dt_days / turnover_time(:,j)
<              turnover_daily(:,j,iroot) = biomass(:,j,iroot) * dt_days / turnover_time(:,j) 
<              turnover_daily(:,j,ifruit) = biomass(:,j,ifruit) * dt_days / turnover_time(:,j)
---
>              turnover(:,j,ileaf) = biomass(:,j,ileaf) * dt / turnover_time(:,j)
>              turnover(:,j,isapabove) = biomass(:,j,isapabove) * dt / turnover_time(:,j)
>              turnover(:,j,iroot) = biomass(:,j,iroot) * dt / turnover_time(:,j) 
>              turnover(:,j,ifruit) = biomass(:,j,ifruit) * dt / turnover_time(:,j)
322,330c320,328
<              turnover_daily(:,j,ileaf)=zero
<              turnover_daily(:,j,isapabove) =zero
<              turnover_daily(:,j,iroot) = zero
<              turnover_daily(:,j,ifruit) =zero
<           ENDWHERE
<           biomass(:,j,ileaf) = biomass(:,j,ileaf) - turnover_daily(:,j,ileaf)
<           biomass(:,j,isapabove) = biomass(:,j,isapabove) - turnover_daily(:,j,isapabove)
<           biomass(:,j,iroot) = biomass(:,j,iroot) - turnover_daily(:,j,iroot)
<           biomass(:,j,ifruit) = biomass(:,j,ifruit) - turnover_daily(:,j,ifruit)
---
>              turnover(:,j,ileaf)=zero
>              turnover(:,j,isapabove) =zero
>              turnover(:,j,iroot) = zero
>              turnover(:,j,ifruit) =zero
>           ENDWHERE
>           biomass(:,j,ileaf) = biomass(:,j,ileaf) - turnover(:,j,ileaf)
>           biomass(:,j,isapabove) = biomass(:,j,isapabove) - turnover(:,j,isapabove)
>           biomass(:,j,iroot) = biomass(:,j,iroot) - turnover(:,j,iroot)
>           biomass(:,j,ifruit) = biomass(:,j,ifruit) - turnover(:,j,ifruit)
371c369
<                      MIN( 0.99_r_std, dt_days / ( leaf_age_crit(:,j) * &
---
>                      MIN( 0.99_r_std, dt / ( leaf_age_crit(:,j) * &
375c373
<                 turnover_daily(:,j,ileaf) = turnover_daily(:,j,ileaf) + dturnover(:)
---
>                 turnover(:,j,ileaf) = turnover(:,j,ileaf) + dturnover(:)
382c380
<                 turnover_daily(:,j,iroot) = turnover_daily(:,j,iroot) + dturnover(:)
---
>                 turnover(:,j,iroot) = turnover(:,j,iroot) + dturnover(:)
386c384
<                 turnover_daily(:,j,ifruit) = turnover_daily(:,j,ifruit) + dturnover(:)
---
>                 turnover(:,j,ifruit) = turnover(:,j,ifruit) + dturnover(:)
416c414
<                      MIN( 0.99_r_std, dt_days / ( leaf_age_crit(:,j) * &
---
>                      MIN( 0.99_r_std, dt / ( leaf_age_crit(:,j) * &
420c418
<                 turnover_daily(:,j,ileaf) = turnover_daily(:,j,ileaf) + dturnover(:)
---
>                 turnover(:,j,ileaf) = turnover(:,j,ileaf) + dturnover(:)
427c425
<                 turnover_daily(:,j,isapabove) = turnover_daily(:,j,isapabove) + dturnover(:)
---
>                 turnover(:,j,isapabove) = turnover(:,j,isapabove) + dturnover(:)
431c429
<                 turnover_daily(:,j,iroot) = turnover_daily(:,j,iroot) + dturnover(:)
---
>                 turnover(:,j,iroot) = turnover(:,j,iroot) + dturnover(:)
435c433
<                 turnover_daily(:,j,ifruit) = turnover_daily(:,j,ifruit) + dturnover(:)
---
>                 turnover(:,j,ifruit) = turnover(:,j,ifruit) + dturnover(:)
497,499c495,497
<              turnover_daily(:,j,ileaf) = turnover_daily(:,j,ileaf) + biomass(:,j,ileaf)
<              turnover_daily(:,j,iroot) = turnover_daily(:,j,iroot) + biomass(:,j,iroot)
<              turnover_daily(:,j,ifruit) = turnover_daily(:,j,ifruit) + biomass(:,j,ifruit)
---
>              turnover(:,j,ileaf) = turnover(:,j,ileaf) + biomass(:,j,ileaf)
>              turnover(:,j,iroot) = turnover(:,j,iroot) + biomass(:,j,iroot)
>              turnover(:,j,ifruit) = turnover(:,j,ifruit) + biomass(:,j,ifruit)
527,530c525,528
<              turnover_daily(:,j,ileaf) = turnover_daily(:,j,ileaf) + biomass(:,j,ileaf)
<              turnover_daily(:,j,isapabove) = turnover_daily(:,j,isapabove) + biomass(:,j,isapabove)
<              turnover_daily(:,j,iroot) = turnover_daily(:,j,iroot) + biomass(:,j,iroot)
<              turnover_daily(:,j,ifruit) = turnover_daily(:,j,ifruit) + biomass(:,j,ifruit)
---
>              turnover(:,j,ileaf) = turnover(:,j,ileaf) + biomass(:,j,ileaf)
>              turnover(:,j,isapabove) = turnover(:,j,isapabove) + biomass(:,j,isapabove)
>              turnover(:,j,iroot) = turnover(:,j,iroot) + biomass(:,j,iroot)
>              turnover(:,j,ifruit) = turnover(:,j,ifruit) + biomass(:,j,ifruit)
582,583c580,581
<                    dturnover(:) = biomass(:,j,ileaf) * dt_days / herbivores(:,j)
<                    turnover_daily(:,j,ileaf) = turnover_daily(:,j,ileaf) + dturnover(:)
---
>                    dturnover(:) = biomass(:,j,ileaf) * dt / herbivores(:,j)
>                    turnover(:,j,ileaf) = turnover(:,j,ileaf) + dturnover(:)
586,587c584,585
<                    dturnover(:) = biomass(:,j,ifruit) * dt_days / herbivores(:,j)
<                    turnover_daily(:,j,ifruit) = turnover_daily(:,j,ifruit) + dturnover(:)
---
>                    dturnover(:) = biomass(:,j,ifruit) * dt / herbivores(:,j)
>                    turnover(:,j,ifruit) = turnover(:,j,ifruit) + dturnover(:)
599,600c597,598
<                    dturnover(:) = biomass(:,j,ileaf) * dt_days / herbivores(:,j)
<                    turnover_daily(:,j,ileaf) = turnover_daily(:,j,ileaf) + dturnover(:)
---
>                    dturnover(:) = biomass(:,j,ileaf) * dt / herbivores(:,j)
>                    turnover(:,j,ileaf) = turnover(:,j,ileaf) + dturnover(:)
603,604c601,602
<                    dturnover(:) = biomass(:,j,isapabove) * dt_days / herbivores(:,j)
<                    turnover_daily(:,j,isapabove) = turnover_daily(:,j,isapabove) + dturnover(:)
---
>                    dturnover(:) = biomass(:,j,isapabove) * dt / herbivores(:,j)
>                    turnover(:,j,isapabove) = turnover(:,j,isapabove) + dturnover(:)
607,608c605,606
<                    dturnover(:) = biomass(:,j,ifruit) * dt_days / herbivores(:,j)
<                    turnover_daily(:,j,ifruit) = turnover_daily(:,j,ifruit) + dturnover(:)
---
>                    dturnover(:) = biomass(:,j,ifruit) * dt / herbivores(:,j)
>                    turnover(:,j,ifruit) = turnover(:,j,ifruit) + dturnover(:)
629,630c627,628
<           dturnover(:) = biomass(:,j,ifruit) * dt_days / tau_fruit(j)
<           turnover_daily(:,j,ifruit) = turnover_daily(:,j,ifruit) + dturnover(:)
---
>           dturnover(:) = biomass(:,j,ifruit) * dt / tau_fruit(j)
>           turnover(:,j,ifruit) = turnover(:,j,ifruit) + dturnover(:)
632,633c630,631
< !!$        turnover_daily(:,j,ifruit) = biomass(:,j,ifruit) * dt_days / tau_fruit(j)
< !!$        biomass(:,j,ifruit) = biomass(:,j,ifruit) - turnover_daily(:,j,ifruit)
---
> !!$        turnover(:,j,ifruit) = biomass(:,j,ifruit) * dt / tau_fruit(j)
> !!$        biomass(:,j,ifruit) = biomass(:,j,ifruit) - turnover(:,j,ifruit)
660c658
<           sapconv(:) = biomass(:,j,isapabove) * dt_days / tau_sap(j)
---
>           sapconv(:) = biomass(:,j,isapabove) * dt / tau_sap(j)
666c664
<           sapconv(:) = biomass(:,j,isapbelow) * dt_days / tau_sap(j)
---
>           sapconv(:) = biomass(:,j,isapbelow) * dt / tau_sap(j)
699c697
<          leaf_meanage, kjpindex*nvm, horipft_index)
---
>          leaf_meanage, npts*nvm, horipft_index)
701c699
<          herbivores, kjpindex*nvm, horipft_index)
---
>          herbivores, npts*nvm, horipft_index)
705c703
<   END SUBROUTINE turn_main
---
>   END SUBROUTINE turn
diff -w --ignore-all-space --ignore-case --recursive --exclude='cvs_diff*' --exclude='*.flc' --exclude='*.bak' --exclude='*.svn*' --exclude='*.lst' --exclude='i.*.L' --exclude='*~' --exclude=Entries --exclude=Tag --exclude=CVS --exclude Makefile /login/IPSL_CODE/AssimilBranche/modeles/ORCHIDEE/src_stomate/stomate_vmax.f90 /login/IPSL_CODE/ORCHIDEE_1_9_5_2/modeles/ORCHIDEE/src_stomate/stomate_vmax.f90
23c23
<   LOGICAL, SAVE                                              :: firstcall_vmax = .TRUE.
---
>   LOGICAL, SAVE                                              :: firstcall = .TRUE.
28c28
<     firstcall_vmax=.TRUE.
---
>     firstcall=.TRUE.
31c31
<   SUBROUTINE vmax (kjpindex, dt_days, &
---
>   SUBROUTINE vmax (npts, dt, &
42c42
<     INTEGER(i_std), INTENT(in)                                        :: kjpindex
---
>     INTEGER(i_std), INTENT(in)                                        :: npts
44c44
<     REAL(r_std), INTENT(in)                                     :: dt_days
---
>     REAL(r_std), INTENT(in)                                     :: dt
49c49
<     REAL(r_std), DIMENSION(kjpindex,nvm,nleafages), INTENT(inout)  :: leaf_age
---
>     REAL(r_std), DIMENSION(npts,nvm,nleafages), INTENT(inout)  :: leaf_age
51c51
<     REAL(r_std), DIMENSION(kjpindex,nvm,nleafages), INTENT(inout)  :: leaf_frac
---
>     REAL(r_std), DIMENSION(npts,nvm,nleafages), INTENT(inout)  :: leaf_frac
56c56
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(out)              :: vcmax
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(out)              :: vcmax
58c58
<     REAL(r_std), DIMENSION(kjpindex,nvm), INTENT(out)              :: vjmax
---
>     REAL(r_std), DIMENSION(npts,nvm), INTENT(out)              :: vjmax
71c71
<     REAL(r_std), DIMENSION(kjpindex)                                :: leaf_efficiency
---
>     REAL(r_std), DIMENSION(npts)                                :: leaf_efficiency
73c73
<     REAL(r_std), DIMENSION(kjpindex,nvm,nleafages)                 :: d_leaf_frac
---
>     REAL(r_std), DIMENSION(npts,nvm,nleafages)                 :: d_leaf_frac
75c75
<     REAL(r_std), DIMENSION(kjpindex,nleafages)                      :: leaf_age_new
---
>     REAL(r_std), DIMENSION(npts,nleafages)                      :: leaf_age_new
77c77
<     REAL(r_std), DIMENSION(kjpindex)                                :: sumfrac
---
>     REAL(r_std), DIMENSION(npts)                                :: sumfrac
79c79
<     REAL(r_std), DIMENSION(kjpindex)                                :: rel_age
---
>     REAL(r_std), DIMENSION(npts)                                :: rel_age
95c95
<     IF ( firstcall_vmax ) THEN
---
>     IF ( firstcall ) THEN
104c104
<        firstcall_vmax = .FALSE.
---
>        firstcall = .FALSE.
128c128
<              leaf_age(:,j,m) = leaf_age(:,j,m) + dt_days
---
>              leaf_age(:,j,m) = leaf_age(:,j,m) + dt
150c150
<           d_leaf_frac(:,j,m) = leaf_frac(:,j,m-1) * dt_days/leaf_timecst(j)
---
>           d_leaf_frac(:,j,m) = leaf_frac(:,j,m-1) * dt/leaf_timecst(j)
