       Subroutine VEGUPDT
C       Implicit none									   
       INCLUDE "parmeta"								  
       INCLUDE "parm.tbl"								  
       INCLUDE "parmsoil"								  
       INTEGER, PARAMETER    :: la=13							  
       INTEGER, PARAMETER    :: imjm=im*jm-jm/2,jam=6+2*(jm-10)  			  
     +      , lp1=lm+1,ltop=1,lbot=lm , lscrch=4*lm+1+la +1  				  
     +      , l1=la+lm+1,l2=la+2*lm+1 , l3=la+3*lm+1,l4=la+4*lm+1			  
       INCLUDE "CTLBLK.comm"								  
       INCLUDE "LOOPS.comm"								  
       INCLUDE "MASKS.comm"								  
       INCLUDE "SOIL.comm"								  
       
       integer  		    :: day						   
       integer  		    :: mon						   
       integer  		    :: yr						   
       integer  		    :: utc						   
       integer  		    :: ma						   
       integer  		    :: mb
       real*4			    :: yday						   
       real*4			    :: add						   
       real*4			    :: fa						   
       real*4			    :: fb
       integer, dimension(12)	    :: monl
       
      iyr=IDAT(3)
      imo=IDAT(1)
      idy=IDAT(2)
      iutc=NTSD*DT/3600     ! chou dt eh 90seg
      CALL getdate(iyr,imo,idy,iutc,yr,mon,day,utc)
       
      data monl /31,28,31,30,31,30,31,31,30,31,30,31/					   
C*			   
       yday=day 									   
       ma=mon-1 
C       write(6,*) yday, mon, day, utc 								   
       If ((yday.ge.(1.0+float(monl(mon))/2.0)).or.
     + ((ntsd.eq.1).and.(yday.gt.15))) ma=mon  
       mb=ma+1	 
       If (ma .lt. 1) ma=12								   
       If (mb .gt. 12) mb=1
       add=float(monl(ma))/2.0-1.0							   
       If (ma.eq.mon) add=-add-2.0							   
       fb=2.0*(yday+add)/float(monl(ma)+monl(mb))					   
       fa=1.0-fb

C       if(MYPE.EQ.0) write(6,*) ntsd,ma,mb,fa,fb,imes,imes2 

       If ((ntsd.eq.1).and.(int(yday).eq.15)) Then					   
         vegfrc=vegfrm(:,:,ma)	
       Else
        vegfrc=fa*vegfrm(:,:,ma)+fb*vegfrm(:,:,mb)
       Endif										   
       RETURN										   
       END
	
