
**********************************************************************************************************************

	function iReadGen8(iU,iFirst)
	character	cMon*3,
     &			cSrce*8,cSrc*8,cSRCVGe*111,cSRCVG*111
	character	Aunfor*115, AunforP*115
	character	onespace*1/' '/
	character	name1*4
	real*8		JDCar(nCar),
     &			dLngSun, dLatSun, dDisSun
     	real*8		Doy8
	real*8		JD1,JEpoch1,JD2,JEpoch2,Doy18,Doy28
	integer		iRA50 (3), iRA (3),
     &			iDEC50(3), iDEC(3)
	external	EARTH8
	save		iY,iMO,iD,iH,iMI,UT,cSrce,iRA50,iDEC50,iRA,
     &			iDEC,ELO,SIZE,iVEL,SN,SCINDX,GVAL,iRec,cSRCVGe
	include		'sun.h'

	iU = iU
C	read (iU,'(2X,3I2,2X,2I2,F8.3,2X,A8,1X,2(1X,6I3),F7.2,F7.3,I6,F6.1,2F7.3)',
C     &		iostat=iReadGen8) iY,iMO,iD,iH,iMI,UT,cSrce,iRA50,iDEC50,iRA,
C     &		iDEC,ELO,SIZE,iVEL,SN,SCINDX,GVAL

	read (iU,'(A115)',
     &		iostat=iReadGen8) Aunfor
	read (Aunfor(1:4),'(A4)') name1
	if(name1.ne.'name') then
	  read (Aunfor(16:22),'(F7.2)') AUT
	  AunforP = Aunfor
	  if(AUT.lt.10.99) then					! Give the file to read an extra space
            write (AunforP(1:15),'(A15)') Aunfor
	    write (AunforP(16:17),'(A1)') onespace
	    write (AunforP(17:107),'(A90)') Aunfor(16:106)
	  end if
	  read (AunforP,'(A8,1X,3I2,1X,F6.2,F5.2,19X,I4,1X,I4,5X,F7.5,I6,2I3,I4,2I3)')
     &		cSrce, iY, iMO, iD, UT, ELO, ICROT, iVel, GVAL, iRA50(1), iRA50(2), iRA50(3), iDEC50(1), iDEC50(2), iDEC50(3)
C
C	  Precess from IRA50, DEC50 to present, end up with the present-day IRA, IDEC
C
	  rLng = (float(iRA50(1))+(float(iRA50(2))+float(iRA50(3))/60.)/60.)*15.	! RA 1950 (deg)
	  if(iDEC50(1).lt.0.or.iDEC50(2).lt.0.or.iDEC50(3).lt.0) then
	    if(iDEC50(3).lt.0) then
	      rLat = float(iDEC50(3))/3600.0
	    else
	      if(iDEC50(2).lt.0) then
		rLat = float(iDEC50(2))/60.0 - float(iDEC50(3))/3600.0
	      else
		rLat = float(iDEC50(1)) - float(iDEC50(2))/60.0 - float(iDEC50(3))/3600.0
	      end if
	    end if
	  else
	    rLat = float(iDEC50(1)) + (float(iDEC50(2)) + float(iDEC50(3))/60.)/60.	! Decl 1950 (deg)
	  end if

	  nYr1  = 1950
	  Doy18 = 0.923D0					! Simonetti "Observational Astrophysics"

	  call Julian8(0,nYr1,Doy18,JD1,JEpoch1)
	  print *, 'After 1st J8', nYr1, Doy18, JEpoch1, rLng, rLat

	  if (iY .lt. 50) iYY = iY+100
	  nYr2  = 1900+iYY
	  cMon = '   '
	  call Date_DOY(0,nYr2,cMon,iMO,iD,iDoy)
	  Doy28 = iDoy+dble(UT/24.)
	  call Julian8(0,nYr2,Doy28,JD2,JEpoch2)

	  print *, 'After 2nd J8', nYr1, Doy18, JEpoch2, rLng, rLat

	  call ECLIPTIC_EQUATOR8(1,nYr1,Doy18,rLng,rLat)	! Convert equatorial to ecliptic (degrees)

	  print *, 'Before precession', nYr1, Doy18, JEpoch2, rLng, rLat

C	  call Precession_Approx(JEpoch1,JEopch2,rLng,rLat)	! Precess to current day
	  call Precession_Rot(JEpoch1,JEopch2,rLng,rLat)	! Precess to current day

	  print *, 'After precession', nYr2, Doy28, JEpoch1, JEpoch2, rLng, rLat

	  call ECLIPTIC_EQUATOR8(0,nYr2,Doy28,rLng,rLat)	! Convert ecliptic to equatorial (degrees)

	  print *, 'After 2nd conversion', nYr2, Doy28, JEpoch1, JEpoch2, rLng, rLat

	  iRA(1)   = int(rlng/15.0)
	  rmaiRA1 = (rlng  - 15.0*float(iRA(1)))*4.0
	  iRA(2)   = int(rmaiRA1)
	  iRA(3)   = nint((rmaiRA1 - float(iRA(2)))*60.0)

	  iRA3P = 0
	  if(iRA(3).ge.60) then
	    iRA3P = iRA(3) - 59
	    iRA(3) = iRA(3) + iRA3P - 61
	  end if
	  iRA2P = 0
	  if((iRA(2)+((iRA3P + 59)/60)).ge.60) then
	    iRA2P = iRA(2) - 59
	    iRA(2) = iRA(2) + iRA2P - 61
	  else
	    iRA2P = 0
	    iRA(2) = iRA(2) + ((iRAP + 59)/60)
	  end if
	  iRA(1) = iRA(1) + ((iRA2P + 59)/60)
	  if(iRA(1).ge.24) iRA(1) = iRA(1) - 24

	  idsign = 1
	  if(rLat.lt.0.0) idsign = -1
	  rLata    = abs(rLat)
	  iDEC(1)  = int(rLata)
	  aiDEC1 = (rLata - float(iDEC(1)))*60.0
	  iDEC(2) = int(aiDEC1)
	  iDEC(3) = nint((aiDEC1 - float(iDEC(2)))*60.0)

	  iDEC3P = 0
	  if(iDEC(3).ge.60) then
	    iDEC3P = iDEC(3) - 59
	    iDEC(3) = iDEC(3) + iDEC3P - 61
	  end if
	  if((iDEC(2)+((iDEC3P + 59)/60)).ge.60) then
	    iDEC2P = iDEC(2) - 59
	    iDEC(2) = iDEC(2) + iDEC2P - 61
	  else
	    iDEC2P = 0
	    iDEC(2) = iDEC(2) + ((iDEC3P + 59)/60)
	  end if
	  if((iDEC(1)+((iDEC2P + 59)/60)).gt.90) then
	    iDEC(1) = 90 - ((iDEC2P + 59)/60)                                                
	    iRA(1)  = 23 - iRA(1)
	    iRA(2)  = 59 - iRA(2)
	    iRA(3)  = 60 - iRA(3)
	  end if
	  iDEC(1) = iDEC(1) - ((iDEC2P + 59)/60)

	  if(iDEC(1).ne.0) then
	    iDEC(1) = iDEC(1)*idsign
	  else
	    if(iDEC(2).ne.0) then
	      iDEC(2) = iDEC(2)*idsign
              else
	      iDEC(3) = iDEC(3)*idsign
	    end if
	  end if
C
	  write(cSRCVGe(1:92),'(A8,1X,3I3,1X,F6.2,F5.2,19X,I4,1X,I4,5X,F7.5,I6,2I3,I4,2I3)')
     &		cSrce, iY, iMO, iD, UT, ELO, ICROT, iVel, GVAL, iRA(1), iRA(2), iRA(3), iDEC(1), iDEC(2), iDEC(3)

	  write(*,'(I4,1X,A8,1X,3I3,1X,F6.2,F5.2,1X,A1,1X,I4,1X,I4,5X,F7.5,I4,2I3,I4,2I3)')
     &		iRec, cSrce, iY, iMO, iD, UT, ELO, '-', ICROT, iVel, GVAL, iRA50(1), iRA50(2), iRA50(3), iDEC50(1), iDEC50(2), iDEC50(3)
	  write(*,'(59X,I4,2I3,I4,2I3)') iRA(1), iRA(2), iRA(3), iDEC(1), iDEC(2), iDEC(3)

	  if (iY .lt. 50) iY = iY+100

	  iRec = (1-iFirst)*iRec+1		! iFirst=1 initializes record counter

	end if
	return
C+
C NAME:
C	iProcessGen8
C CALLING SEQUENCE:
	entry iProcessGen8(iR,nCar,JDCar,NCoff,XCend,Radius,
     &		cSRCVG,cSrc,nYr,Doy8,XCsc,XCobs,xLat,xVV,xGG,dRA,
     &		rLngSun,rDisSun,rLngP,rLatP,rEloP)
C-

**********************************************************************************************************************



 372   210.215     5.550    69.929   519.000     3.379								<------Source
 After 1st J8        1950  0.923000000000000        1949.99978918549        176.8333       13.06667    
 After 2nd J8        1950  0.923000000000000        2013.57356605066        176.8333       13.06667    
 Before precession        1950  0.923000000000000        2013.57356605066        171.8481       10.71992    
 After precession        2013   210.245000004768        1949.99978918549        2013.57356605066        144.6818       10.68731    
 After 2nd conversion        2013   210.245000004768        1949.99978918549        2013.57356605066        150.8357       23.33492    
1055 3C267     13  7 29   5.88 0.82 - 2139  715     3.31445  11 47 20  13  4  0      				<------ Input
                                                             10  3 21  23 20  6	     				<-------Output

 373   210.245     5.929    26.456   715.000     3.314
 After 1st J8        1950  0.923000000000000        1949.99978918549        175.2083       22.41639    
 After 2nd J8        1950  0.923000000000000        2013.57364818619        175.2083       22.41639    
 Before precession        1950  0.923000000000000        2013.57364818619        166.4171       18.61007    
 After precession        2013   210.275000005960        1949.99978918549        2013.57364818619        139.2145       18.55332    
 After 2nd conversion        2013   210.275000005960        1949.99978918549        2013.57364818619        148.3984       32.56474    
1056 3C263.1   13  7 29   6.60 0.76 - 2139  850     4.73999  11 40 50  22 24 59
                                                              9 53 36  32 33 53

 374   210.275     5.912    49.405   850.000     4.740
 After 1st J8        1950  0.923000000000000        1949.99978918549        175.2083       22.41639    
 After 2nd J8        1950  0.923000000000000        2013.57373146249        175.2083       22.41639    
 Before precession        1950  0.923000000000000        2013.57373146249        166.4171       18.61007    
 After precession        2013   210.305416673422        1949.99978918549        2013.57373146249        139.2145       18.55332    
 After 2nd conversion        2013   210.305416673422        1949.99978918549        2013.57373146249        148.3984       32.56474    
1057 3C263.1   13  7 29   7.33 0.76 - 2139  715     6.55856  11 40 50  22 24 59
                                                              9 53 36  32 33 53

 375   210.305     5.908    49.466   715.000     6.559
 After 1st J8        1950  0.923000000000000        1949.99978918549        202.2042       30.76611    
 After 2nd J8        1950  0.923000000000000        2013.57389687423        202.2042       30.76611    
 Before precession        1950  0.923000000000000        2013.57389687423        186.7659       36.76267    
 After precession        2013   210.365833312273        1949.99978918549        2013.57389687423        159.4567       36.79677    
 After 2nd conversion        2013   210.365833312273        1949.99978918549        2013.57389687423        178.5047       41.40117    
1058 3C286     13  7 29   8.78 1.17 - 2139  823     1.12189  13 28 49  30 45 58
                                                             11 54  1  41 24  4

 376   210.366     5.803    35.338   823.000     1.122
 After 1st J8        1950  0.923000000000000        1949.99978918549        49.03750       16.29417    
 After 2nd J8        1950  0.923000000000000        2013.57540497382        49.03750       16.29417    
 Before precession        1950  0.923000000000000        2013.57540497382        50.98413      -1.775486    
 After precession        2013   210.916666686535        1949.99978918549        2013.57540497382        23.86099      -1.978605    
 After 2nd conversion        2013   210.916666686535        1949.99978918549        2013.57540497382        22.82407       7.418939    
1059 CTA21     13  7 29  22.00 1.32 - 2139  796     0.74976   3 16  9  16 17 39
                                                              1 31 18   7 25  8

