C------------------------------------------------------------------
C  GLMTYR  GENERATE SHOT YEAR FROM SHOT NUMBER BY HISTORICAL ANALYSIS
C
C  GLMT vsn adapted from TFTRYR.FOR
C  04/15/13 C. Ludescher-Furth
C           shot info from Robert Budny

C
      SUBROUTINE GLMTYR(NSHOT,ZYEAR)
C
      implicit NONE
C
      integer NSHOT
      CHARACTER*(*) ZYEAR
C
      integer ilen
C
C
      zyear=' '
      ilen=len(zyear)
C from Gleb Kurskiev
C  2074   2000      #1
C  1180   2001      #2075
C  1539   2002      #3256
C  2498   2003      #4796
C  4258   2004      #7295
C  4274   2005      #11554
C  2848   2006      #15829
C  1845   2007      #18678
C  2704   2008      #20524
C  1907   2009      #23229
C  2444   2010      #25137
C  1705   2011      #27582
C  1321   2012      #29288
C  2135   2013      #30610
C  2389   2014      #32746
C  1036   2015      #35136
C
      if(ilen.gt.3) then
         IF(NSHOT.GE.23229) then
            ZYEAR(ilen-3:ilen)='2009'
         else IF(NSHOT.GE.20524) then
            ZYEAR(ilen-3:ilen)='2008'
         else IF(NSHOT.GE.18678) then
            ZYEAR(ilen-3:ilen)='2007'
         else IF(NSHOT.GE.15829) then
            ZYEAR(ilen-3:ilen)='2006'
         else IF(NSHOT.GE.11554) then
            ZYEAR(ilen-3:ilen)='2005'
         else IF(NSHOT.GE.7295) then
            ZYEAR(ilen-3:ilen)='2004'
         else IF(NSHOT.GE.4796) then
            ZYEAR(ilen-3:ilen)='2003'
         else IF(NSHOT.GE.3256) then
            ZYEAR(ilen-3:ilen)='2002'
         else IF(NSHOT.GE.2075) then
            ZYEAR(ilen-3:ilen)='2001'
         endif
      else
         IF(NSHOT.GE.35136) then
            ZYEAR(ilen-1:ilen)='15'
         else IF(NSHOT.GE.32746) then
            ZYEAR(ilen-1:ilen)='14'
         else IF(NSHOT.GE.30610) then
            ZYEAR(ilen-1:ilen)='13'
         else IF(NSHOT.GE.29288) then
            ZYEAR(ilen-1:ilen)='12'
         ELSE IF(NSHOT.GE.27582) then
            ZYEAR(ilen-1:ilen)='11'
         else IF(NSHOT.GE.25137) then
            ZYEAR(ilen-1:ilen)='10'
         else
            ZYEAR(ilen-1:ilen)='09'
         endif
      endif
C
      RETURN
      END

 
