!copyright (C) 2001  MSC-RPN COMM  %%%RPNPHY%%%
***
**
*

      REAL FUNCTION INTERPVEG( JULIEN, TABLE ) 34
*
#include "impnone.cdk"
*
*
      REAL JULIEN
      REAL TABLE(13)
*
*
*Author
*           S. Belair (February 1999)
*
*
*Revision
* 001
*
*
*Object
*           Interpolate the characteristics of the vegetation 
*           (vegetation fraction and leaf area index mainly)
*           for the day of the year, using a table with monthly
*           values
*
*
*Arguments
*
*           - Input -
* JULIEN    Julian day
* TABLE     Table of monthly values (the first month is repeated
*           at the end, so the dimension is 13 instead of 12)
*
*
**
***
**
*
      INTEGER MONTH
      REAL MONTHL, HALFM, YEARL
      REAL DAY, DAYOFMONTH
*
*
      yearl  = 366.
      monthl = yearl / 12.
      halfm  = yearl / 12. / 2.
*
*
      day        = julien - halfm
      if (day.lt.0.) day = day + yearl
*
      month      = INT( day / monthl ) + 1
      dayofmonth = day - float(month-1)*monthl
*
*
      interpveg  = table(month) 
     1           + dayofmonth / monthl * (table(month+1)-table(month))
*
*
      RETURN
      END