      program testchadr5x25
C calculates Delta alpha from 5 quark sector, using tabled in hadr5n23.f 
      implicit none
      integer i,n,ier
C      real e,emin,emax,de,dst2
      double precision e,emin,emax,de,dst2
      double complex dcder,dcdeg,dcerrdersta,dcerrdersys,
     &     dcerrdegsta,dcerrdegsys
      double precision der,deg,dimagder,dimagdeg,
     &     errder,errdeg,errimagder,errimagdeg
C      complex*8 dcder,dcdeg,dcerrdersta,dcerrdersys,
C     &     dcerrdegsta,dcerrdegsys
C      real der,deg,dimagder,dimagdeg,
C     &     errder,errdeg,errimagder,errimagdeg
      dst2=0.23153d0
      n=300
      n=200
      n=400
      write (1,*) '      4.00000 '
      write (1,*) '      1.00000 '
      write (1,*) '   ',float(n-1)
      write (1,*) 'c energy(GeV),    der     ,   tot_error'
      write (2,*) '      4.00000 '
      write (2,*) '      1.00000 '
      write (2,*) '   ',float(n-1)
      write (2,*) 'c energy(GeV),    deg     ,   tot_error'
      write (3,*) '      4.00000 '
      write (3,*) '      1.00000 '
      write (3,*) '   ',float(n-1)
      write (3,*) 'c energy(GeV),    imag der     ,   tot_error'
      write (4,*) '      4.00000 '
      write (4,*) '      1.00000 '
      write (4,*) '   ',float(n-1)
      write (4,*) 'c energy(GeV),    imag deg     ,   tot_error'
      emin= -120.00d0
      emax= 0.0d0
      emin= 0.32d0
      emax= 0.98d0
C      emin= 0.5d0
C      emax= 0.8d0
      read (*,*)  emin,emax
      de=(emax-emin)/n
      ier=0
      e=emin
      do i=1,n 
         call dchadr5x25(e,dst2,dcder,dcerrdersta,dcerrdersys,
     &        dcdeg,dcerrdegsta,dcerrdegsys)
         der=DREAL(dcder)
         deg=DREAL(dcdeg)
         dimagder=DIMAG(dcder)
         dimagdeg=DIMAG(dcdeg)
         errder=sqrt(DREAL(dcerrdersta)**2+DREAL(dcerrdersys)**2)
         errdeg=sqrt(DREAL(dcerrdegsta)**2+DREAL(dcerrdegsys)**2)
         errimagder=sqrt(DIMAG(dcerrdersta)**2+DIMAG(dcerrdersys)**2)
         errimagdeg=sqrt(DIMAG(dcerrdegsta)**2+DIMAG(dcerrdegsys)**2)
         write (1,98) e,der,errder
         write (2,98) e,deg,errdeg
         write (3,98) e,dimagder,errimagder
         write (4,98) e,dimagdeg,errimagdeg
         e=e+de
      enddo
      write (*,*) ' Results: real parts der on fort.1, deg on fort.2'
      write (*,*) '          imag parts der on fort.3, deg on fort.4'
 98   format(3(2x,1pe12.5))
      end
