      SUBROUTINE CONVERT(DDATE,NYEAR,NDAY,NHOUR,NMIN,NSEC,MSEC)         
C                                                                       
C CONVERT DECIMAL YEAR INTO CALENDAR DATE                               
C                                                                       
      REAL*8 DDATE,YEAR,DAY,HOUR,MIN,SEC,FSEC,DAYS
      NYEAR = JIDINT(DDATE)                                              
      YEAR = DBLE(NYEAR)                                              
      DAY = (DDATE-YEAR)*DAYS(NYEAR)                                    
      NDAY = JIDINT(DAY) + 1                                             
      HOUR = (DAY-DBLE(NDAY-1))*24.0D0                                
      NHOUR = JIDINT(HOUR)                                               
      MIN = (HOUR-DBLE(NHOUR))*60.0D0                                 
      NMIN = JIDINT(MIN)                                                 
      SEC = (MIN-DBLE(NMIN))*60.0D0                                   
      NSEC = JIDINT(SEC)                                                 
      FSEC = (SEC-DBLE(NSEC))*1000.0D0                                
      MSEC = JIDINT(FSEC)                                                
      IF (MSEC.GE.1000) THEN                                            
       NSEC = NSEC + 1                                                  
       MSEC = MSEC - 1000                                               
      END IF                                                            
      IF (NSEC.GE.60) THEN                                              
       NMIN = NMIN + 1                                                  
       NSEC = NSEC - 60                                                 
      END IF                                                            
      IF (NMIN.GE.60) THEN                                              
       NHOUR = NHOUR + 1                                                 
       NMIN = NMIN - 60                                                 
      END IF                                                            
      IF (NHOUR.GE.24) THEN                                             
       NDAY = NDAY + 1                                                  
       NHOUR = NHOUR - 24                                               
      END IF                                                            
      IF (NDAY.GT.JIDINT(DAYS(NYEAR))) THEN                                     
       NYEAR = NYEAR + 1                                                
       NDAY = NDAY - JIDINT(DAYS(NYEAR))                                        
      END IF                                                            
      RETURN                                                            
      END                                                               
