C------------------------------------------------------------------
C  SPRCYR  GENERATE SHOT YEAR FROM SHOT NUMBER BY HISTORICAL ANALYSIS
C
C  SPRC vsn adapted from TFTRYR.FOR

C
      SUBROUTINE SPRCYR(NSHOT,ZYEAR)
C
      implicit NONE
C
      integer NSHOT
      CHARACTER*(*) ZYEAR
C
      integer ilen
      INTEGER, DIMENSION(:), ALLOCATABLE :: idigs
      INTEGER :: num_digits, ix, rem
C
C
      num_digits = FLOOR(LOG10(REAL(NSHOT)+1))
      ALLOCATE(idigs(num_digits))
      rem = NSHOT
      DO ix = 1, num_digits
         idigs(ix) = rem - (rem/10)*10 ! Take advantage of integer division
         rem = rem/10
      END DO
      write(zyear,'(i2)') idigs(num_digits)*10+idigs(num_digits-1)
      DEALLOCATE(idigs)
C
      RETURN
      END
