      Program Tabc
C---- Convert 4 SCFS scattering factors to GFMLX format
      INTEGER I,J,K,L,M,N
      REAL  VAL0(102), VAL1(102), VAL2(102), VAL3(102), VAL4(102)
C---- Open files
      OPEN(11,FILE='FORM.TAB',STATUS='OLD',
     1ACCESS='SEQUENTIAL',FORM='FORMATTED',READONLY)
      OPEN(12,FILE='FORM.GFM',STATUS='NEW',
     1ACCESS='SEQUENTIAL',FORM='FORMATTED')
C---- Reading/writing loop
      DO 200 N = 1, 4
      READ(11,'(25x,f10.6)') (VAL0(I),I=3,102)
      VAL0(2)=VAL0(4)
      VAL0(1)=VAL0(5)
C---- First difference
      DO 101 I=1,101
 101  VAL1(I)=VAL0(I+1)-VAL0(I)
C---- Second difference
      DO 102 I=2,101
 102  VAL2(I)=VAL1(I)-VAL1(I-1)
C---- Third difference
      DO 103 I=2,100
 103  VAL3(I)=VAL2(I+1)-VAL2(I)
C---- Fourth difference
      DO 104 I=3,100
 104  VAL4(I)=VAL3(I)-VAL3(I-1)
C---- Modified second difference
      DO 105 I=3,100
 105  VAL2(I)=VAL2(I)-0.18333*VAL4(I)
C---  Set interval
      VAL0(2)=0.02
      VAL2(2)=0.02
      WRITE(12,'(8F9.3)') (VAL0(I),I=2,33)
      WRITE(12,'(8F9.3)') (VAL2(I),I=2,33)
 200  CONTINUE
c---- Close files
      CLOSE(11,STATUS='KEEP')
      CLOSE(12,STATUS='KEEP')
      STOP
      END
