      PROGRAM FSTAND
      PARAMETER(ISIZE=800)
      DIMENSION X(ISIZE),NYC(ISIZE),IX(ISIZE)
      CHARACTER*6 DENT
      CHARACTER*4 TYPE,FORM
      IC=3
      DO 98 K=1,2000
      CALL RINFRN(DENT,ISY,IEY,X,NYC,ISIZE,IC,TYPE,FORM)   
      NN=IEY-ISY+1
      if(nn.le.200)go to 98
      DO 95 J=1,NN
   95 IX(J)=X(J)+0.5
      CALL WINFRN(DENT,ISY,IEY,IX,NYC,ISIZE,8,
     >TYPE,FORM)
   98 CONTINUE
      STOP
      END
      SUBROUTINE RINFRN(DENT,ISYEAR,IEYEAR,X,NC,ISIZE,IC,TYPE,FORM)   
      DIMENSION X(ISIZE),NC(ISIZE)  
      CHARACTER*6 DENT  
      CHARACTER*4 TYPE,FORM
      READ(IC,100)DENT,ISYEAR,IEYEAR,TYPE,FORM
  100 FORMAT(a6,2I4,2A4,F4.1,F6.1,A4,I1) 
      N=IEYEAR-ISYEAR+1 
      K=MOD(ISYEAR,10)  
      NR=N+K
      READ(IC,101)(X(I),NC(I),I=1,NR)   
  101 FORMAT((10x,10(F4.0,I3))) 
      DO 1 I=1,N
      NC(I)=NC(I+K) 
  1   X(I)=X(I+K)   
      RETURN
      END   
      SUBROUTINE WINFRN(DENT,ISYEAR,IEYEAR,IY,NC,ISIZE,IC,  
     >TYPE,FORM)
      DIMENSION IY(ISIZE),NC(ISIZE) 
      CHARACTER*6 DENT  
      CHARACTER*4 TYPE,FORM
      N=IEYEAR-ISYEAR+1 
      NN=N  
      WRITE(IC,12)DENT,ISYEAR,IEYEAR,TYPE,FORM
   12 FORMAT(A6,2I4,2A4)
      IYS=MOD(ISYEAR,10)
      IF(IYS.EQ.0)GO TO 23  
      IIY=N+IYS 
      IIX=IIY   
      NNN=N 
      DO 11 III=1,NNN   
      IY(IIX)=IY(N) 
      NC(IIX)=NC(N) 
      IIX=IIX-1 
      N=N-1 
   11 CONTINUE  
      DO 13 I=1,IYS 
      IY(I)=9990
      NC(I)=0   
   13 CONTINUE  
      GO TO 15  
   23 CONTINUE  
      IIY=N 
   15 MIE=10-(MOD(IEYEAR,10)+1) 
      IF(MIE.EQ.0)GO TO 20  
      IAY=IIY+1 
      IBY=(IAY+MIE)-1   
      DO 17 NN=IAY,IBY  
      IY(NN)=9990   
      NC(NN)=0  
   17 CONTINUE  
      GO TO 18  
   20 IAY=IIY+1 
      IBY=IAY   
   18 WRITE(IC,19)DENT,ISYEAR,(IY(I),NC(I),I=1,10)  
   19 FORMAT(A6,I4,10(I4,I3))   
      IX=(IBY/10)-1 
      IN=11 
      INN=IN+9  
      IDEC=((ISYEAR+10)/10)*10  
      DO 9 IS=1,IX  
      WRITE(IC,7)DENT,IDEC,(IY(I),NC(I),I=IN,INN)   
    7 FORMAT(A6,I4,10(I4,I3))   
      IN=IN+10  
      INN=IN+9  
      IDEC=IDEC+10  
    9 CONTINUE  
      DO 30 I=1,NN  
      NC(I)=NC(I+IYS)   
  30  IY(I)=IY(I+IYS)   
      RETURN
      END   
