# Works in progress for Nicolas Viovy version

## Work on phenology

1/ Change in calcul of date for heat summing taht become fixed: a new subroutine rad been added to stomate_season that calculate the winter solstice from orbital parameters. This is the base date used for heat sum 2/ Change in calcul of phenology of crops. In stomate turnover, a new senescence_type created: crop. In this case senescence is set when a prescribe gdd_senescence has been set. Value calibrated to represent winter wheat and maize for C4 3/ come back to modification of senescence of grass that now can vary along the year and then able to reproduce the decrease of LAI during summer. It was not possible with old pheno because of interaction between senescence and begin of season

## Work on soil depth

Now it is possible to read a different soil depth for each pixel. then dpu_cste that was a constant become dependent of npts. Also when read swc is now expressed in mm/mm

## Work on vegetation dynamics

Constraints now depend on soil water

## Work on convergence with sönke code

1. a problem when using the old photosynthesis. In diffuco_trans_co2 there where a divide by gstop not protected by a test gstop>0
we have to replace:
```        DO inia=1,nia
!
iainia=index_assi(inia)
!
rveget(iainia,jv) = 1./gstop(iainia)
!
ENDDO
```
by
```        DO inia=1,nia
!
iainia=index_assi(inia)
!
IF (gstop(iainia) > min_sechiba) THEN
rveget(iainia,jv) = 1./gstop(iainia)
ELSE
rveget(iainia,jv) = 1e5
ENDIF
!
ENDDO
```
and
```        DO inia=1,nia
!
iainia=index_assi(inia)
!
! rstruct is the difference between rtot (=1./gstot) and rveget
!
rstruct(iainia,jv) = 1./gstot(iainia,jv) - &
rveget(iainia,jv)
!
ENDDO
```
by
```       DO inia=1,nia
!
iainia=index_assi(inia)
!
! rstruct is the difference between rtot (=1./gstot) and rveget
!
IF (gstot(iainia,jv) > min_sechiba) THEN
rstruct(iainia,jv) = 1./gstot(iainia,jv) - &
rveget(iainia,jv)
ELSE
rstruct(iainia,jv) =0
ENDIF
!
ENDDO
```
2. A problem in the first call to npp_calc. There is a line where scal = 1./ind(i,j) * cn_ind(i,j) whereas ind and cn_ind are not wet defined (so set to 0) corrected by putting a return at the end of the initialisation block:
```IF (firstcall) THEN .....
firstcall= .FALSE.
RETURN
ENDIF
```
3. Something which is probably very machine dependent but on titane whish is very very sensitive to precision problem (also when using simple precision) but anyway better to correct it: in stomate_season there is a calculation of rue_longterm
```    !
! 14.1 longterm radiation use efficiency
!
DO j=2,nvm
WHERE(biomass(:,j,ileaf,icarbon)) .GT. min_stomate)
rue_longterm(:,j) =  ( rue_longterm(:,j) * ( one_year - dt ) + &
gpp_daily(:,j) / (1. - exp(-0.5 * biomass(:,j,ileaf,icarbon)*sla(j))) * dt ) / (one_year)
ENDWHERE
ENDDO
```
in some case there is un FP error since (1. - exp(-0.5 * biomass(:,j,ileaf,icarbon)*sla(j))) * dt ) is probably near 0 so
I replaced the:
```     WHERE(biomass(:,j,ileaf,icarbon)) .GT. min_stomate)
```
by
```     WHERE((1. - exp(-0.5 * biomass(:,j,ileaf,icarbon)*sla(j))) .GT. min_stomate)
```
Last modified on 11/24/10 09:23:51