C	Vector meson fragmentation functions from a simple broken SU(3)
C	model; H Saveetha, D. Indumathi, 2017.
C	Code to generate fragmentation functions for vector mesons
C	rho, kstar, omega, phi, for given (Q2, x).
        implicit real*8 (a-h, o-z)

	parameter (iqbin=77, ixbin=70)
        parameter (meqn=28, mxgrd=70)!actually need only 6*4, not 7*4

C	For the interpolations:
	real*8 Qfit, xfit ! data
	integer khad ! khad = 1,2,3,4= rho,kstar,omega,phi

C	Read the tables and initialise:
	call inittab() ! the values are now in the 2D arrays
C	Now have 2D tables of all ffs for all hadrons. Use these to
C	generate the D(x) at interpolated Q2 for each data point.

	print*, 'khad, Qfit, xfit, Du, Dd, Ds, Dc, Db, Dg'
C	Read/assign the (Q2, x) values at which want to determine the
C	fragmentation functions:
	do i = 1, 100
	  print*, 'What type of hadron do you want?'
	  print*, 'khad = 1,2,3,4= rho0,(kstar0+kstar0bar)/2,omega,phi'
	  read*, khad
	  print*, 'What is Q2, x?'
	  read*, Qfit, xfit
	  call fit(Qfit, xfit, khad, Du, Dd, Ds, Dc, Db, Dg)
C	  Du=Du+Dubar; Dd=Dd+Ddbar; Ds=Ds+Dsbar; Dc=Dc+Dcbar;
C	  Db=Db+Dbbar; Dg=Dg
	  print*, khad, Qfit, xfit, Du, Dd, Ds, Dc, Db, Dg
	end do
	end

