      program xcarr2ut_rt
!
!     Exercise program for random trials of carr2ut_rt
!
!     B. Knapp, 2001-01-10
!
C
C     RCS DATA
C     
C     $Header$
C     
C     $Log$
C
C
      implicit none
!
      integer*4 iseed, i, n, itns, itnsmax
      parameter (n=1000000)
      real*8 jd, carr, djd, djdmax
      real*4 ran1
      external ran1
!
!     Generate random JD, n times
      iseed = -135676531
      itnsmax = 0
      djdmax = -1.0d0
      do i=1,n
         jd = 2.25d6+ran1(iseed)*0.5d6
         call carr2ut_rt(jd, carr, djd, itns)
         if (abs(djd) .gt. djdmax .or. itns .gt. itnsmax) then
            djdmax = max(djdmax, abs(djd))
            itnsmax = max(itnsmax, itns)
            write(*,10) jd, carr, djd, itns
 10         format(2f24.16,1pe16.6,i8)
         endif
      enddo
      end
